
102. Binary Tree Level Order Traversal
·
Algorithm
Binary Tree Level Order Traversal - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1. Queue를 사용한 풀이 class Solution: def levelOrder(self, root: TreeNode) -> List[List[int]]: answer = [] if not root: return [] q = deque([]) q.append((root, 0)) trace = {} while q: cur_node, cur_level..