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
Get step-by-step solutions from verified subject matter experts
