1 describe the differences between our


1. Describe the differences between our specifications of the Sorted List ADT and the Binary Search Tree ADT.

2. Write a client method that returns a count of the number of nodes in a binary search tree that contain a value less than or equal to the argument value. The signature of the method is: intcountLess(BinarySearchTree tree, Golfer maxValue)  

3. Draw the binary search tree whose elements are inserted in the following order: 50, 72, 96, 94, 107, 26, 12, 11, 9, 2, 10, 25, 51, 16, 17, 95 

4. Suppose 100 integer elements are chosen at random and are inserted into a sorted link list and a binary search tree. Describe the efficiency of searching for an element in each structure, in terms of Big-O notation.

5. Show the tree that would result from storing the nodes of the tree in Figure 8.19(a) (in your textbook) in postorder order into an array, and then traversing the array in index order while inserting the nodes into a new tree.

6. It is possible to define more operations for a Graph ADT. Describe two operations that you think would be useful additions to the WeightedGraphInterface.

7. Class WeightedGraph is to be extended to include a removeVertex operation, which removes a vertex from the graph. Deleting a vertex is more complicated than deleting an edge from the graph. Discuss the reasons for this operations's greater complexity.

8. Our shortestPaths method is concerned with the minimum distance between two vertices of a graph. Create a minEdges method that returns the minimum number of edges that exist on a path between two given vertices. You can put your new method in our useGraph class in the textbook and use it to test your code.

368_Binary Search Tree ADT.png

Figure

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: 1 describe the differences between our
Reference No:- TGS0485580

Now Priced at $70 (50% Discount)

Recommended (98%)

Rated (4.3/5)