Draw binary search tree (inorder)

Draw binary search tree, which in inorder traversal gives the following sequence of numbers -> 1, 6, 3, 2, 5, 4, 8, 7, 9
thanks
No. I think they mean you should do it.
So...what's the problem ?
We do not do h/w, show us your code, tell us whats wrong, and we can see if we can help you.
I do not need your code i just need to draw that tree in inorder traversal

...........5........
....6..........8..
..1...3... 7...9...
......2....

Is that right ?
It is almost correct. The order of the numbers after 5 is not correct and you forgot 4.
Do you have any suggestion for me for how to do it??
You manage to do most of it so I don't think the rest should be a problem. Look at the right subtree of 5. Note that there are many possible solutions.
In inorder traversal, always check if there are any child nodes on left hand side, then the root node comes. So if you get 3,6 instead of 6,3 (just a random example) while traversing you can change the positions of 6 and 3.
Last edited on
So can anyone of you guys show me how you would construct this binary tree because im prety confused
@magicalLeno
Do you understand what "inorder traversal" means?
Not completely, can you please enlighten me
Topic archived. No new replies allowed.