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...


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.



May 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here