Question: In C++: (Depth of BST) Add a function in BST to return the depth of the tree. // Return the height of this binary tree.

In C++: (Depth of BST) Add a function in BST to return the depth of the tree.

// Return the height of this binary tree. Height is the

// number of nodes in the longest path from the root

Int height()

Your sample output should show the sentence:

"DURING the whole of a dull, dark, and soundless day in the autumn of the year, when the clouds hung oppressively low in the heavens, I had been passing alone, on horseback, through a singularly dreary tract of country; and at length found myself, as the shades of the evening drew on, within view of the melancholy House of Usher."

Parsed and input into a binary search tree. It should display the tree with an inorder traversal. Run the height() function and display the results.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!