标签:logs nbsp pop rsa traversal sem ack res tac
public class Solution { public List<Integer> inorderTraversal(TreeNode root) { List<Integer> res=new ArrayList<Integer>(); Stack<TreeNode> stack=new Stack<TreeNode>(); while(root!=null||!stack.isEmpty()) { while(root!=null) { stack.push(root); root=root.left; } root=stack.pop(); res.add(root.val); root=root.right; } return res; } }
94. Binary Tree Inorder Traversal
标签:logs nbsp pop rsa traversal sem ack res tac
原文地址:http://www.cnblogs.com/asuran/p/7609277.html