Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
Walk from the target node up to the root in Tree A, recording the child index at each level to build a path. Then follow that same index path from the root of Tree B downward to locate the corresponding node.
Since both trees have identical structure, a node's position is uniquely identified by its index path from the root. Replaying that path in the clone tree lands on the structurally equivalent node.
Updated Feb 2026