left tree to right tree
2 posters
Page 1 of 1
left tree to right tree
Covert a left binary search tree to Right binary search tree?
shivang- Posts : 42
Join date : 2009-01-30
Age : 35
Re: left tree to right tree
this can be done by rotataion
p1=head
p2=p1->left
then make p1 as right child of p1
then move dowm to p2 child then assign
p3=p2->left
now again make p2 as right child of p3
similarly traverse the whole tree
p1=head
p2=p1->left
then make p1 as right child of p1
then move dowm to p2 child then assign
p3=p2->left
now again make p2 as right child of p3
similarly traverse the whole tree
mnnit.rahul- Posts : 51
Join date : 2009-02-01
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|