


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Information about homework assignments for a computer science course, specifically focusing on tries and bst (trie and binary search tree). The assignments include questions related to implementing remove function in trie, contrasting notions of 'average' and 'expected' in bst, and balancing an unbalanced node in avl tree. Students are expected to answer questions in the document and provide diagrams for some of the questions.
Typology: Assignments
1 / 4
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.