Is there a way to convert from a general tree to binary SEARCH tree? -


i know how convert general tree binary tree fine,

                      / | \          /    b  c  d   ->   b                    \                     c                      \                       d 

i asked how convert general tree binary search tree though. thoughts person asked me either didn't mean binary search tree (i asked him, said did), or he's misunderstanding class notes. in case, has heard of doing this? general tree binary search tree? answer gave him first convert binary tree sort binary search tree. correct?

i think have traverse initial tree , insert each node binary search tree. after that, have converted initial tree bst.

for traversing tree click here

for binary search tree info , insertion method click here


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -