Reputation: 51
We have a given array and we want to print each node's level in the BST.
For example if the given array is: {15, 6, 2, 10, 9, 7, 13}
then the answer is:
1 2 3 3 4 5 4
(it means that the level of node that stores 15 is 1 and ...)
I have some algorithms in my mind but I don't know how to implement them in code.
Upvotes: 0
Views: 44
Reputation: 2165
These are the steps that you should follow :
Upvotes: 1