AlgoMaster Logo

Flatten Binary Tree to Linked List

tree=[1, 2, 5, 3, 4, null, 6]
0 / 12
algomaster.io
Step:Start: collect the nodes in preorder, then rewire into a right chain