[LeetCode] 100. Same Tree
·
알고리즘 문제풀이/LeetCode
문제 기본 트리 문제이다. TreeNode 클래스가 주어지며, 2개의 이진트리 p, q가 주어질 때 같은 트리인지 아닌지 확인하는 문제이다. https://leetcode.com/problems/same-tree/ Same Tree - 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 풀이 p와 q의 노드를 저장할 Queue를 생성한다. (pQueue, qQueue) p와 q를 각각 Queue에 저장한다. pQueue가 비어있을 때까지 다음을 반복한다. 1) pQu..