Traverse the tree and list the nodes


Discuss the below:

Q: Use the following tree, in its original from, for each part of this question:

1181_tree.jpg

(a). If the value 33 is inserted into the tree, which node would be its parent?

(b). If the value 72 is inserted into the tree, which node would be its parent?

(c). If the root node 50 is deleted, the erase algorithm selects which node as the replacement node?

(d). If the node 30 is deleted, the erase algorithm selects which node as the replacement node?

(e). Traverse the tree, and list the nodes, via a preorder scan.

(f). Traverse the tree, and list the nodes, via an inorder scan.

(g). Traverse the tree, and list the nodes, via an postorder scan

(h). Traverse the tree, and list the nodes, via an level-order scan

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Traverse the tree and list the nodes
Reference No:- TGS01937151

Now Priced at $25 (50% Discount)

Recommended (99%)

Rated (4.3/5)