Data Structures: Fall 2004
Finals Review
Draw figures, etc.
- Given a binary search
tree, show the order in which nodes are visited in the following traversals (i)
preorder, (ii) postorder, (iii) inorder, and (iv) level-order.
- Given a sequence of
insert and delete operations on (i) a BST, (ii) an AVL tree, or (iii) a hash
table (open addressing or chaining), draw a figure of the appropriate data
structure.
- Given a sequence of
insert and search operations on a self-adjusting BST of a (single rotations or
move to root), draw the tree.
- Given a sequence of
insert (push) and DeleteMax/DeleteMin (pop) on a Max/Min heap, draw the heap,
using pointers and using an array.
- Given an array, draw figures to show the steps in the
heap initialization algorithm.
Write code fragments
- Write code for the
following: (i) tree traversals, (ii) insert, delete, and search on BST, AVL
tree, self-adjusting BST, and hash tables, (iii) push, pop, and top on max and
min heaps, (iv) heap initialization, (v) rotations on different types of BSTs,
(vi) largest node, smallest node, etc, of a BST.
- Write an iterator class
for a given class.
- Learn the three basic features of an STL
priority_queue class (push, pop, and top -- these correspond to certain
operations on a heap).
Times complexities
- Give the time
complexities for performing various operations on all the data structures that
we have studied in this class.
- Given an application, choose a suitable data structure
for it, giving a rational justification for your choice.
Proofs and analysis
- Given a recursive
function, give the time complexity of executing it as a function of its
arguments.
- Derive the expected and
worst case time complexities for insertion, deletion, and search on BST, AVL
trees, self-adjusting BST, and hash tables.
- Derive bounds on the
height, number of nodes, and number of leaves of binary trees, BST, AVL trees,
and heaps.
- Derive the time
complexity of push, pop, top, and initialization of a heap.
- Prove properties for
different types of trees.
- Prove that algorithms
with certain time complexities are impossible, using the fact that comparison
base sorting cannot be performed in time O(n).
- Disprove the correctness
of some statement, using a counterexample.
- Determine the index of
the children and the parent of a node, in the array representation of a
complete tree, which need not be a binary tree, and prove that our answer is
correct, using induction.