leetcode | A non-recursive implementation of preorder traversal, inorder traversal, and subsequent traversal of binary trees

Preorder traversal: visit the node first, then visit the left subtree and right subtree of the node;
in-order traversal: visit the left subtree of the node first, then visit the node, and then visit the right subtree of the node
; In-order traversal: want to visit the left subtree and right subtree of the node, and then visit the node.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326486646&siteId=291194637