
103. Binary Tree Zigzag Level Order Traversal
·
Algorithm
Binary Tree Zigzag 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 이진트리가 주어진다. root level을 0이라고 했을 때 0, 2, 4, 6,.... 레벨의 노드는 왼쪽에서 오른쪽으로 순회하고, 1, 3, 5, 7,... 레벨의 노드는 오른쪽에서 왼쪽으로 순회한 결과를 반환하는 문제다. 1. Deque, BFS를 사용한 풀이 from typing import * from collections impo..