

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!


50 70
10
40
80
20
60
30
a. What tree results after you insert the nodes 65 , 75 , 43 , 47 , 35 , and 25 in
that order. Note: not an AVL tree; a Binary Search Tree.
50 70
10
40
80
20
60
30
65
75
47
43
35
25
b. After inserting the nodes mention in Part a , what tree results when you
delete node 40 using the following strategies?
i. Show the Part a tree after the deletion if the in-order predecessor is
used as the replacement for the deleted node.
50 70
10
35
80
20
60
30
65
75
47
43
25
Printed 2020/11 ๆ/29 at 23:
ii. Show the Part a tree after the deletion if the in-order successor is
used as the replacement for the deleted node.
50 70
10
43
80
20
60
30
65
75
47
25 35
a. What binary search tree is created by inserting the data in the order give?
b. Given the search key 12, trace the algorithm that searches the binary search tree
that you created in Part a. List the nodes in the order in which the search visits
them.
8, traverse right.
13, traverse left.
10, traverse right.
Printed 2020/11 ๆ/29 at 23: