In-order Traversal Of Binary Tree

# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def inOrder(self, root): """ input: TreeNode root return: List<Integer> """ # write your solution here s = []

3 Responses

What's the meaning of the stack?
@Yuqiong Li Implement an iterative, in-order traversal of a given binary tree, return the list of keys of each node in the tree as it is in-order traversed.
@Yuqiong Li It's like the computer stack where we store variables to pass into the next level of recursion.

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.