Friday, November 04, 2005

Solution to the Interesting problem with trees

I posted a problem in Problem with Trees. The answer is posted below, use the Euler's tour to verify. If it is not correct, I know where I would be losing marks in the exam.

tree_ip2

2 comments:

Anonymous said...

How can your solution be incorrect, man?
BTW, I verified it and it seems ok.

Gops.

Balbir said...

The really interesting thing is that B is the leftmost leaf -- as per inorder and P is not its parent, so it took a long time to figure out the correct answer in the exam.

Thanks for verifying it for me! I will get some marks for sure!

Ranking and Unranking permutations

I've been a big fan of Skiena's Algorithm Design Manual , I recently found my first edition of the book (although I own the third ed...