Consider an array-based implementation of a binary search tree bst . Figure 16-1 presents such a representation for a particular binary search tree.
a. Depict the array in an array-based implementation for the binary search tree. Assume that tree items are strings.
b. Show the effect of each of the following sequential operations on the array in part a of this exercise.
bst.add("Doug");
bst.add("Nancy");
bst.add("Bob");
bst.add("Sarah");
c. Repeat parts a and b of this exercise for the tree.
d. Write an in order traversal algorithm for this array-based implementation.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here