Monday, September 29, 2014

Binary Tree Inorder Traversal

Problem

Given a binary tree, return the inorder traversal of its nodes' values.

For example:

Idea

Use stack. Push left child to stack &nbsp > &nbsp push_back(parent->val) to result &nbsp > &nbsp push right child to stack.

Solution


No comments:

Post a Comment