Skip to content

Latest commit

 

History

History

clone-binary-tree-with-random-pointer

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

< Previous                  Next >

Related Topics

[Hash Table] [Tree] [Depth-First Search] [Breadth-First Search] [Binary Tree]

Similar Questions

  1. Clone Graph (Medium)
  2. Copy List with Random Pointer (Medium)
  3. Clone N-ary Tree (Medium)

Hints

Hint 1 Traverse the tree, keep a hashtable with you and create a nodecopy for each node in the tree.
Hint 2 Start traversing the original tree again and connect the left, right and random pointers in the cloned tree the same way as the original tree with the help of the hashtable.