


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Spring 2002 Sharat
CMSC 420: Homework 2: Tries and BST
(a) Implement remove(String x, TrieNode p) in time proportional to length of x.
(b) Show pictures similar to the one for insert when the strings bull, stop, buy, bid, bell, bear, sell, and stock are removed in order.
(a) Prove the above statement using the first four odd numbers.
(b) Which notion do you prefer? Why?
(b) Use a constructor of the form Node(Key k, Node toRight, Boolean iAmLeaf) to complete in O(log n) time Node i n s e r t ( Key k , Node p ) {
(c) (Optional) Implement remove(Key k, Node p)
(d) Draw four figures to show the execution of your insert code that generates the figure above.