Tree View - Bottom View
Learn Tree View - Bottom View (Trees, Data Structures & Algorithms) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Bottom View - What's Visible Looking Up Same horizontal-distance idea as Top View, but the LAST (deepest) node at each horizontal distance wins instead of the first. Use unconditional overwrite ( put ) rather than putIfAbsent - since BFS processes in increasing depth order, each new node at a given HD replaces the previous one, so whatever remains after the full scan is the deepest.
More lessons in Trees
- Binary Tree
- Binary Search Tree - BST
- Full / Complete / Perfect Binary Tree
- Balanced Tree
- Tree Traversal - Preorder
- Tree Traversal - Inorder
- Tree Traversal - Postorder
- Tree Traversal - Level Order
- Recursive Traversal
- Iterative Traversal
- Height / Depth
- Diameter of a Tree
- Lowest Common Ancestor
- Path Sum
- Tree View - Left View
- Tree View - Right View
- Tree View - Top View
- Boundary Traversal
- Vertical Traversal
- Zigzag Traversal
- Serialize / Deserialize a Tree
- BST Operations
- BST Validation
- Kth Smallest / Largest in BST
- Morris Traversal