Zero To DSAZero To DSA
Privacy Policy
Maximum Depth of Binary TreeValidate Binary Search Tree

Binary Tree Inorder Traversal

easy
Time: O(n)
Space: O(h)

Given the root of a binary tree, return the inorder traversal of its nodes' values (iteratively).

Constraints

  • The number of nodes is in the range [0, 100].

Examples

Input: root = [1,null,2,3]
Output: [1,3,2]
Input: root = []
Output: []