Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The tree search to locate the position in the tree where a new node is to be ins

ID: 3622567 • Letter: T

Question

The tree search to locate the position in the tree where a new node is to be inserted must be iterative in procedure InsertBinarySearchTree(Root: in out BinarySearchTreePoint; custName: in String10; custPhone: String10 );. You may not use recursion to implement any method other than FindCustiomerRecursive in the “C” option.
Process the following transactions in the indicated order:

1) Insert the following data in the tree using InsertBinarySearchTree: Ingle, 295-1492; Houck, 291-1864; Pullen, 295-1601; Leal, 293-6122; Fleming, 295-1882; Hallaway, 291-7890; Ingle, 294-8075, Robinson, 584-3622.

2) Find Turner and print the phone number using FindCustomerIterative.

3) Find Turner and print the phone number using FindCustomerRecursive.

4) Find Fleming and print the phone number using FindCustomerIterative.

5) Find Fleming and print the phone number using FindCustomerRecursive.


6) Starting with Pullen, traverse the entire tree in inorder back to Pullen printing the name field of each node encountered. (you should be able to do this starting at any node, i.e., find Pullen using a binary search then traverse the tree from this point in inorder).
7) Insert Wolter, 294-1568; Lewis, 294-1882; and Aryal 295-6622.

8) Traverse the tree in inorder starting at the root using the method InOrderSuccessor. Print the name and phone number of each node as it is encountered.

Explanation / Answer

2.0