Hi,
I would really appreciate any help on this.
Doubling tree is a problem where a duplicate node is inserted as a left child for each node in a binary search tree.
This code works:
Code:
void doubleTree(root)
{
if(root == NULL) return;
else
{
doubleTree(root->LeftChild);
doubleTree(root->RightChild);
...
.....
<create a new node and insert as the left child with data field of the node same as node>
}
}
but this doesnt: ????????
Code:
void doubleTree(root)
{
if(root == NULL) return;
else
{
...
.....
<create a new node and insert as the left child with data field of the node
same as node>
doubleTree(root->LeftChild);
doubleTree(root->RightChild);
}
}
Shouldnt it work??