-
자료구조 - 이진 탐색트리 - 중요인공 지능 개념 2024. 9. 22. 15:43
이진 탐색트리
노드의 특징
1. 왼쪽 자식의 값은 항상 현재노드(부모노드)보다 작다.
2. 오른쪽 자식의 값은 항상 현재노드(부모노드)보다 크다.
3. 이 속성은 트리의 모든 노드에 대해 재귀적으로 적용된다.
트리의 구조
1. 왼쪽 서브트리의 모든 노드는 부모 노드보다 값이 작아야 한다.
2. 오른쪽 서브트리의 모든 노드는 부모노드의 값보다 커야한다.
값찾을때
root 보다 값이 작을때 왼쪽 서브트리 찾고
root보다 값이 클때 오른쪽 서브트리 찾는다.
아래그림)
삭제방법
'인공 지능 개념' 카테고리의 다른 글
구술시험 준비 (0) 2024.09.24 자료구조 - AVR 트리 (0) 2024.09.22 자료구조 - 이진탐색 (Binary Search) (0) 2024.09.22 자료구조 - 트리탐색 (0) 2024.09.22 자료구조 - Heap (2) (0) 2024.09.21