Saturday, July 23, 2016

Clone a Binary Tree with Random Pointers

Given a Binary Tree where every node has following structure.
struct node {  
    int key; 
    struct node *left,*right,*random;
} 
The random pointer points to any random node of the binary tree and can even point to NULL, clone the given binary tree.


No comments:

Post a Comment