This preview shows page 1. Sign up to view the full content.
Unformatted text preview: 1 is not full, so T 2 is full and height(T 2 )=height(T)-2=3-2=1, which T 2 has exactly 3 elements. Thus the last 3 elements of our inorder are the inorder of the full tree, the 4 th element from the right is the root of T, the elements on the left of the root of T are the inorder of T 2 which is a complete tree. Hence: Since T 1 is full then one may easy find out that ROOT(T 1 )= 4, LEFT(ROOT(T 1 ))=1, RIGHT(ROOT(T 1 ))=9. For T 2 we repeat the same reasoning as for T. Finally out three T is:...
View Full Document
This note was uploaded on 12/10/2009 for the course CAS 2c03 taught by Professor Janicki during the Spring '03 term at McMaster University.
- Spring '03