2c03-review - 00056

2c03-review - 00056 - 11.[10] Give an example of a binary...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
1 11.[10] Give an example of a binary search tree which is a complete tree. Can it be done for an arbitrary number of nodes? Prove your answer. Yes. First, construct complete tree with n nodes. Get the inorder list of the complete tree, say, a1,a2,…an. Let a1 be the smallest number, a2 be second smallest number, and so on. Then, the complete tee obtained is a binary search tree with n nodes. 12.[10] We can sort a given set of n numbers by first building a binary search tree containing
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online