

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
Some concept of Data Structures are Abstract, Balance Factor, Complete Binary Tree, Dynamically, Storage, Implementation, Sequential Search, Advanced Data Structures, Graph Coloring Two, Insertion Sort. Main points of this lecture are: Programming, Binary Search Tree, Delete, Result, Simpler Problem, Deleting, One Child, Deleting a Node, Ordering, Overwriting
Typology: Study notes
1 / 2
This page cannot be seen from the preview
Don't miss anything!


a. What would need to be done to delete 32 from the BST?
b. What would need to be done to delete 9 from the BST?
c. What would be the result of deleting 50 from the BST? Hint: One technique when programming is to convert a hard problem into a simpler problem. Deleting a BST node that contains two children is a hard problem. Since we know how to delete a BST node with none or one child, we can convert “deleting a node with two children” problem into a simpler problem by overwriting 50 with another node’s value. Which nodes can be used to overwrite 50 and still remain the BST ordering?
d. Which node would the TreeNode’s findSuccessor method return for succ if we are deleting 50 from the BST?
70, 90, 80, 5, 30, 110, 95, 40, 100
b) If a BST contains n nodes and we start searching at the root, what would be the worst-case big-oh O ( ) notation for a successful search? (Draw the shape of the BST leading to the worst-case search)
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 Index 0 Not Used
b) What would be the worst-case storage needed for a BST with n nodes?
b) What is the worst-case big-oh O ( ) notation for a successful search in this “best” shape BST?