LeetCode Binary Tree Level Order Traversal
LeetCode 102 in detail — the queue-with-size BFS pattern, why DFS still works, and how this template extends to zigzag and right-side view.
·5 min read · #dsa#leetcode#trees
3 posts.
LeetCode 102 in detail — the queue-with-size BFS pattern, why DFS still works, and how this template extends to zigzag and right-side view.
LeetCode 417 explained — why you should flood from the oceans inward, not from each cell outward, and how the intersection gives the answer.
LeetCode 127 walked through — the wildcard-pattern adjacency trick, why BFS is mandatory, and the bidirectional speedup.