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

Binary search

English

Binary search

The array is sorted. Return the index of target, or -1 if it isn't there. Binary search halves the range each step: check the middle element, then keep looking in just the left or right half. Far faster than scanning every element.

한국어

이진 검색

이 배열은 정렬되어 있습니다. target의 인덱스를 반환하고, 존재하지 않으면 -1을 반환하세요. 이진 탐색은 매 단계마다 범위를 절반으로 줄입니다: 중간 요소를 확인한 후 왼쪽 또는 오른쪽 절반 중 하나만 계속 탐색합니다. 모든 요소를 스캔하는 것보다 훨씬 빠릅니다.

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

IGCSE, A-Level & AP