Sunday, October 30, 2005

Interesting problem with trees

This years DLPD exam had the following question

Given a binary tree and the following traversal information

In-Order : B P D Q K A C L T E F
Pre-Order: A K B D P Q L C F T E

construct the original tree.

Its an interesting problem, can you find the solution and back it up with logic - the problem solving approach you followed?

No comments:

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...