Unformatted text preview: i := h ( k ), and set j := 0 (b) Probe in position i for the desired key k . If you ²nd it, or if this position is empty, terminate the search (c) Set j := ( j + 1) (mod m ) and i := ( i + j ) (mod m ), and return to the previous step Assume that m is a power of 2. (a) Show that this scheme is an instance of the general “quadratic probing” scheme by exhibiting the appropriate constants c, d for the corresponding equation (b) Prove that this algorithm examines every table position in the worst case. 3. Prove that no matter what node we start at in a height h binary search tree, k successive calls to TreeSuccessor take O ( k + h ) time. 4. Is the operation of Deletion “commutative” in the sense that deleting x and then y from a binary search tree leaves the same tree as deleting y and then x ? Argue why or give a counterexample. 1...
View
Full Document
 Fall '09
 A.BULATOV
 Algorithms, Data Structures

Click to edit the document details