BFS(너비우선탐색)

    9/13 (수) BFS를 이용한 한 문제 풀이와 바뀐 LeetCode 레이아웃 TIL

    공부한 것LeetCode #199. Binary Tree Right Side ViewLeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/binary-tree-right-side-view/=> 주어진 이진 트리를 오른쪽으로 뉘여서 보았을 때 가장 윗면에 노출되는 노드를 root쪽부터 순서대로 배열에 담아서 반환하는 문제다. = 주어진 트리..

    9/1 (금) 트리 문제 기초 접근법을 3가지로 정리하다 TIL

    공부한 것LeetCode #226. Invert Binary TreeLeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/invert-binary-tree/description/트리를 뒤집어 반환하는 문제이다. 각 노드별로 좌우 자식을 바꿔주면 되고 이는 결국 노드를 전부 방문해야 한다는 얘기가 된다. 기초적인 전위 순회(Preorder ..

    8/28 (월) 너비 우선 탐색(BFS)과 새로운 메소드 TIL

    공부한 것LeetCode #100. Same TreeLeetCode - The World's Leading Online Programming Learning PlatformLevel 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.https://leetcode.com/problems/same-tree/Tree 카테고리로 넘어왔다. 기본적으로 재귀 호출이 필요한 구조인 듯 하다. LeetCode #110. Balanced Binary TreeLeetCode - The World's Leading Online Prog..