How can i order the nodes in BST?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can i order the nodes in BST??

I want to print the node its arrange(order) is 4 not its value Could anyone help me ?

29th Jul 2020, 9:04 AM
Michel Ghaith
Michel Ghaith - avatar
1 Answer
0
We'll need a bit more info. Do you have it written in code playground? If so, share that code and I'll try to point you in the right direction. It'll be hard to help you otherwise. If you're using recursion then you could have a counter variable which increments by 1 every time a node is visited and the the value of the counter can be output instead of the value of the node.
29th Jul 2020, 11:28 AM
benjamin