CISC 320 review sheet for first midterm exam
Exam covers Chapters 4 (trees), 6 (analysis),
8 (insertion sort), 9 (quicksort, selection), 11 (heapsort, priority queues),
12 (mergesort - less emphasis),
14 (searching), 15 (2-3-4 trees, red-black trees),
16 (hashing), 18 (B-trees only).
19 (knuth-morris-pratt algorithm only).
The old exam, handed out, is NOT representative of what you can expect.
Nonetheless it shows where the emphasis is on comparing the merits
of various algorithms for searching and sorting.
Questions on this exam will be true/false or short answer, for the
most part. You might be asked to complete or modify the implementation
of an algorithm.
study guide (sample questions)
- Which sorting method guarantees worst case time of O(n log(n))?
- An element can be inserted in a heap by placing it at the end,
increment n (the size of the heap) and calling upheap. What does upheap
do?
- Which sorting method is particularly good on almost sorted lists?
- Give a precise definition of "almost sorted" for the purpose of the
preceeding question.
- Give an example of a case where sorting of an almost sorted list
comes up.
- What sorting method we've studied is best on large "random" arrays?
- What sorting method is best on short arrays? How short?
- What disadvantage does mergesort have relative to quicksort?
- What disadvantage does quicksort have relative to mergesort?
- What is the maximum number of nodes in an order 2 B-tree?
- What is the maximum number of records (keys and associated data)
in an order 2 B-tree, when all data is stored at the leaves.
- What is the range of depths at which leaves might occur in
a red-black tree with 31 keys?
- What is the black death? Oh, sorry, that's medieval history 101.
What is the black depth of a node in a red-black tree?
What is the range of possible black depths of leaves in a red-black tree
with 31 nodes?
- What does the "rotate" function do in red-black trees. Which of the
basic dictionary functions call rotate in the red-black implementation
- What advantage does a hash table have over a balanced tree for
searching?
- what advantage does a balanced tree have over a hash table?
- which searching method guarantees each search, insert, and delete
takes no more than O(log(n)) comparisons, on a dictionary containing n keys?
- What does the Knuth-Morris-Pratt algorithm do? How does it do it?
saunders@cis.udel.edu