1. //BT to BST - function used is to swap values
Node* bubbleData(Node *root)
{
if(!root)
return NULL;
if(root->right)
{
if(root->data> root->right->data)
swap(&(root->data),&(root->right->data));
root->right = bubbleData(root->right);
}
if(root->left)
{
if(root->data < root->left->data)
swap(&(root->data),&(root->left->data));
root->left = bubbleData(root->left);
}
return bubbleData(root);
}
any case missing??
3. Do we have to give an algorithm for garbage collection like Mark
sweep algo or Do we have to write a code? if code, plz tell how to
write?
On Jul 18, 4:59 pm, Balaji S <[email protected]> wrote:
> 1. Convert a binary tree to binary search tree inplace..
> 2. Convert a DLL to a binary search tree that is balanced.
> 3. Implement a C++ garbage collector efficiently
>
> --
> With Regards,
> Balaji.S
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.