> For the complete documentation index, see [llms.txt](https://krjaeh0.gitbook.io/j-log/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://krjaeh0.gitbook.io/j-log/programming/cs-fundamentals/overviews/datastructuresalgorithms/searchalgorithmoverview.md).

# SearchAlgorithmOverview

## 탐색 알고리즘(Search Algorithm)이란?

* 주어진 데이터에서 특정한 값을 찾는 알고리즘
* 배열, 리스트, 트리, 그래프 등의 데이터 구조에서 원하는 값을 찾는 방법을 정의하는 알고리즘

✔ 탐색 대상: 배열, 연결 리스트, 트리, 그래프 등

✔ 탐색 방식: 선형 탐색, 이진 탐색, 해시 탐색, DFS, BFS 등 다양한 방법 존재

✔ 효율적인 탐색을 위해 정렬이 필요한 경우도 있음

## 탐색 알고리즘의 종류

| 탐색 알고리즘               | 설명                                 | 시간 복잡도 (최선/평균/최악)          | 정렬 필요 여부 | 특징                     |
| --------------------- | ---------------------------------- | -------------------------- | -------- | ---------------------- |
| 선형 탐색 (Linear Search) | 순차적으로 하나씩 비교하며 찾음                  | O(1) / O(n) / O(n)         | ❌ 필요 없음  | 단순하지만 느림               |
| 이진 탐색 (Binary Search) | 정렬된 배열에서 절반씩 탐색                    | O(1) / O(log n) / O(log n) | ✅ 필요함    | 정렬된 데이터에서 매우 효율적       |
| 해시 탐색 (Hashing)       | 해시 함수를 이용한 빠른 검색                   | O(1) / O(1) / O(n)         | ❌ 필요 없음  | 해시 충돌이 발생하면 성능 저하 가능   |
| 트리 탐색 (Tree Search)   | 이진 트리 기반 탐색 (DFS, BFS)             | O(log n) / O(log n) / O(n) | ✅ 필요함    | 균형 트리 사용 시 O(log n) 유지 |
| 그래프 탐색 (Graph Search) | 그래프에서 최적 경로 탐색 (DFS, BFS, 다익스트라 등) | O(V+E) / O(V+E) / O(V+E)   | ❌ 필요 없음  | 경로 탐색, 최단 경로 문제 해결     |

✔ 탐색 알고리즘의 선택은 데이터 구조, 데이터 크기, 정렬 여부 등에 따라 다름

✔ 일반적인 배열 탐색에는 선형 탐색과 이진 탐색이 많이 사용됨

✔ 선형 탐색 → 정렬 필요 없음, 단순하지만 O(n)으로 느림

✔ 이진 탐색 → 정렬된 배열에서 O(log n)으로 빠름

✔ 해시 탐색 → O(1)로 가장 빠르지만, 해시 충돌이 발생하면 성능 저하

✔ 트리 탐색 → BST 사용 시 O(log n) 탐색 가능

✔ 그래프 탐색 → DFS, BFS를 사용하여 노드 탐색 및 경로 탐색 수행


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://krjaeh0.gitbook.io/j-log/programming/cs-fundamentals/overviews/datastructuresalgorithms/searchalgorithmoverview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
