Assume this tree is a BST a What node is the successor of no

Assume this tree is a BST: a) What node is the successor of node A? b) What node is the successor of node B? c) What node is the successor of node C? d) What is the height of the tree? e) What is the maximum number of nodes that could be added to the tree without increasing its height? f) Is the tree an AVL tree? g) If we remove only node H, is the result an AVL tree? h) If we remove only node J, is the result an AVL tree? i) If we remove only node K, is the result an AVL tree?

Solution

a. What node is the successor to node A?

It depends on the type of traversal. In the in-order traversal, the successor of A is J, where as in the preorder traversal, the successor of node A is, B. And for postorder traversal, the node A will not have any successors.

b. What node is the successor to node B?

It depends on the type of traversal. In the in-order traversal, the successor of B is E, where as in the preorder traversal, the successor of node B is, D. And for postorder traversal, the successor of node B is, J.

c. What node is the successor to node C?

It depends on the type of traversal. In the in-order traversal, the successor of C is K, where as in the preorder traversal, the successor of node C is, F. And for postorder traversal, the successor of node C is, A.

d. What is the height of the tree?

The heigh of the tree is 4.

 Assume this tree is a BST: a) What node is the successor of node A? b) What node is the successor of node B? c) What node is the successor of node C? d) What i

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site