leetcode 94 binary tree inorder traversal
Given a binary tree, return the inorder traversal of its nodes’ values.
Example:
1 | Input: [1,null,2,3] |
solution one
Recursive Approach
1 | /** |
solution two
iterating method using stack
1 | class Solution { |
later equals never
Given a binary tree, return the inorder traversal of its nodes’ values.
Example:
1 | Input: [1,null,2,3] |
Recursive Approach
1 | /** |
iterating method using stack
1 | class Solution { |