LeetCode – Binary Tree Vertical Order Traversal (Java)

Given a binary tree, return the vertical order traversal of its nodes’ values. (ie, from top to bottom, column by column). Java Solution 1 For each node, its left child’s degree is -1 and is right child’s degree is +1. We can do a level order traversal and save the degree information. public List<List<Integer>> verticalOrder(TreeNode … Read more