코딩 테스트 이론 - 백트래킹 (Backtracking)
백트래킹은기본적으로 Tree..DFS의 Preorder Traversal (전위 순회: Root → Left → Right)로 풀이 가능 https://hyunkookim.tistory.com/365 BST 이진 검색 트리(height, Depth, DFS 검색 방법: inorder, preorder, postorder)height 는 자식이 없는 노드가 1이고Depth 는 부모 root 노드가 1로 시작 DFS 검색 방법: 깊이 우선 탐색 (Depth-First Search, DFS)깊이 우선 탐색(DFS)은 코딩 인터뷰에서 가장 자주 등장하는 알고리즘 중 하hyunkookim.tistory.com class TreeNode: def __init__(self, val): self.va..