Leetcode – Binary Tree Inorder Traversal (Java)
There are 3 solutions for solving this problem. Java Solution 1 – Iterative The key to solve inorder traversal of binary tree includes the following: The order of “inorder” is: left child -> parent -> right child Use a stack to track nodes public List<Integer> inorderTraversal(TreeNode root) { ArrayList<Integer> result = new ArrayList<>(); Stack<TreeNode> stack … Read more