Question 1 (25 pts):Figure 1 An AVL tree
By using the AVL tree in Figure 1;
(a) List the node at which the balance criteria are violated after inserting 52 into the tree in Figure
1.
(b) List the type of rotation required.
(c) Redraw the tree after inserting 52.
(d) List the node at which the balance criteria are violated after inserting 41 into the tree in Figure
1.
(e) List the type of rotation required.
(f) Redraw the tree after inserting 41.
Question 2 (25 pts):
Figure 2 A B-Tree of order 5
By using the B-tree in Figure 2;
(a) Redraw the tree after inserting 55.
(b) Redraw the tree after inserting 28 to the tree in (a).
(c) Redraw the tree after inserting 42 to the tree in (b).
(d) Redraw the tree after inserting 100 to the tree in (c).
Question 3 (25 pts):
Figure 3 Another B-Tree of order 5
By using the B-tree in Figure 3;
(a) Redraw the tree after deleting 22.
(b) Redraw the tree after deleting 16 from the tree in (a).
(c) Redraw the tree after deleting 4 from the tree in (b).
Question 4:
Rewrite the definition of the function searchNode of the class B-tree provided (bTree.h) by using a
binary search. Write a C++ code to ask the user to enter a list of positive integers ending with -999,
build a b- tree of order 5 using the positive integers, and display the tree contents. Also, ask the user to
enter a number to search and display if the number is found in the tree.
Submit the source code, and copy and paste the screenshot of the output here.
The binary search implementation can be found in the textbook page 503-504. Make sure to update
location after if, else if, and else.