We have the following sequence of numbers : 10, 2, 7, 6, 3, 8, 5, 18, 1 and 9

a.) Draw binary search tree, which originate, if numbers from sequence are inputed into empty binary search tree and write out sequence of numbers in reverse traversal of a tree
b.)Draw binary search tree, which originate, if numbers from sequence are inputed into empty binary search tree in reverse order and write out sequence of numbers in preorder traversal.

Thanks for you help guys

09-09-2012

laserlight

Are you required to implement a C program here, or is this just a matter of computer science?

Oh, and what have you tried?

09-09-2012

amazineous

I do not need any code i just need to draw binary search tree with this numbers but i do not know how to start

09-09-2012

laserlight

*Thread moved to General Discussions*

Quote:

Originally Posted by amazineous

i just need to draw binary search tree with this numbers but i do not know how to start

Review your notes on binary search trees. In particular, try to construct the examples to get an understanding of what they are about.

09-09-2012

amazineous

Are there many possible solutions to this problem ? And how do i know which number is the root. Is it right if i order this numbers into ascending order first and than i construct a binary tree?

09-09-2012

Shakti

The way I read the question you should construct the binary search tree that would result from inserting the numbers in sequence into an empty tree. That is, start with an empty tree, then construct the tree you get by inserting the number 10. Then take that tree and construct the tree you get from inserting the number 2 and so on. More info on binary search tree: Binary search tree - Wikipedia, the free encyclopedia

09-09-2012

amazineous

So would anyone of you guys who knows how to construct this binary tree be so kind and show me because i got no clue how to start