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 Singh 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!

Dynamic programming for the binomial coefficient

More fun things, this time with some visualisation of what happens when memoisation is used and what happens when we don't. I don'...