← Amazon questions

Deep copy a binary tree with random pointers without extra space

Filed under Amazon

Given a binary tree where each node contains left, right, and random pointers, create a deep copy of the tree without using any extra space (such as a hash map).

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.