The TransCompilator

Solved LeetCode program · 94 of 1,000

#0094 · Binary Tree Inorder Traversal

Easy Depth-First Search chunk-02.md

Original English source

Keep a shared values holding 1, 2, and 3. Keep a shared lefts holding -1, 2, and -1. Keep a shared rights holding 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. Gather from item node of lefts. Place node into order. Gather from item node of rights.

Gather from 0. For each node in order, display item node of values.

Open in Playground Browse all 1,000 problems

Expected stdout

1
3
2