Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
given a full binary tree find i and jth positions and also find the path and trace the movements.
Posted
Comments
phil.o 15-Apr-15 5:22am    
What have you tried? Where are you stuck?

1 solution

you must only log all operation step after step in a matter which suites your needs. You must only log whether you choose the left or the right node. So you will left with a log like "LRLRRR" or "010111". If you save the depth of your tree walk you can use bit shift operations.

Sounds like a teenager homework. :-O
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900