Skip to content · ⁨본문 바로가기⁩

Searching: linear and binary · ⁨검색: 선형 및 이진⁩

English

Finding a value

  • A common job is to search: is a value in an array, and where?
  • The usual answer is the index where we found it, or -1 if it is not there.
  • We learn two ways: linear search (works on any array) and binary search (needs a sorted array, but is much faster).
한국어

값 찾기

  • 일반적인 작업은 검색입니다: 배열에 특정 값이 있는지, 있다면 어디에 있는지 확인하는 것입니다.
  • 일반적으로 찾은 위치의 인덱스를 반환하거나, 없으면 **-1**를 반환합니다.
  • 두 가지 방법을 배웁니다: 선형 검색(임의의 배열에서 작동)과 이진 검색(정렬된 배열이 필요하며 훨씬 빠름).

Handout · ⁨교재 자료⁩

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP