탐색
선형 탐색과 이진 탐색이 목표 값을 단계별로 찾는 과정을 살펴보세요 — 비교, 절반 축소, 성공/실패 결과.
Linear SearchScan the array one element at a time until the target appears.Binary SearchHalve the search window each step until the target is found.
탐색 비교
| 알고리즘 | 최선 | 평균 | 최악 | 공간 | 정렬된 데이터 필요? |
|---|---|---|---|---|---|
| Linear Search | O(1) | O(n) | O(n) | O(1) | No |
| Binary Search | O(1) | O(log n) | O(log n) | O(1) | Yes |