Question: 2. Imagine a binary tree structure is fed the following data: 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 in that exact order.

2. Imagine a binary tree structure is fed the following data: 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 in that exact order. What is the depth of the tree? Clearly this is an example of an imbalanced tree, define a function called node * rotright(node * n) which will move the root of the tree once to the right, in this case the root would be 9 instead of the original 10. I am looking for pseudo code that when provided the root returns the new root AFTER doing any other manipulations of the left and right child pointers is complete.

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!