Solved LeetCode program · 114 of 1,000
#0114 · Flatten Binary Tree to Linked List
Original English source
Keep a shared values holding 1, 2, 5, 3, 4, and 6. Keep a shared lefts holding 1, 3, -1, -1, -1, and -1. Keep a shared rights holding 2, 4, 5, -1, -1, and -1. Keep a shared order as an empty list of whole numbers.
To gather from node (a whole number). If node is less than 0, return. Place node into order. Gather from item node of lefts. Gather from item node of rights.
Gather from 0. For each node in order, show item node of values.
Expected stdout
1 2 3 4 5 6