Leetcode 623 . Add one Row to Tree (Binary tree)


Leetcode 623 . Add one Row to Tree (Binary tree)

https://leetcode.com/problems/add-one-row-to-tree/ Add One Row to 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 정해진 depth 까지 도달했을 때, 주어진 val을 왼쪽과 오른쪽 노드로 삽입하고 기존의 왼쪽 노드는 새로운 노드의 왼쪽, 기존의 오른쪽 노드는 새로운 노드의 오른쪽으로 재배열 하는 문제입니다. 제가 처음에 접근했던 방식은 BFS로 stack을 통해 아래 로직을 전개하는걸로 생각했습니다..


원문링크 : Leetcode 623 . Add one Row to Tree (Binary tree)