Lab 8 - Binary Search Trees

The purpose of this lab is to understand the operations of a binary search tree by tracing out the operations on paper.

For this lab, you will be tracing out the operations of the binary search tree. Either bring a pencil and paper to class for this lab, or have an electronic method of showing the trace of the operations.

Part I - Insertion

Insert the following values into a binary search tree (BST) in the order given:
56, 43, 12, 78, 92, 5, 23, 62, 35
Show the tree after inserting each value.

Part II - Deletion

Show the tree after deleting each of the following values:
62, 43, 56, 12
Show the tree after each deletion.

Part III - Traversals

Give the output for the post-order (LRV) traversal of the tree left over after the last deletion. Recall from lecture and the homework assignment that the post-order traversal will be used to deallocate the entire tree, so the output will show the order in which the nodes will be deleted when the entire tree is deallocated at the same time.

Turn in your paper to Terry or upload your electronic document to Moodle by clicking on the assignment in Moodle and using the "upload this file" button.