강의

멘토링

커뮤니티

Inflearn Community Q&A

xyzyeahyeah6653's profile image
xyzyeahyeah6653

asked

Introduction to Python Algorithm Problem Solving (Coding Test Preparation)

1. Dichotomous search

이분검색 질문있습니다.

Written on

·

176

0

테스트 케이스 1번값이 4가 아니라 14인가요?

오름차순을 하면 다음과 같고, mid값으로 비교하면 4번만에 검색할 수 있을것 같은데 14인 이유가 궁금합니다ㅠ

15 99
[73, 32, 31, 49, 94, 37, 40, 62, 78, 66, 27, 100, 99, 29, 9]


-----------
left mid right list[mid]
0 7 14 49
8 11 14 78
12 13 14 99
python코테 준비 같이 해요!

Answer 1

0

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

문제가 물어본 것은 정렬한 상태에서 99가 몇 번째 위치해 있는지 찾으라는 겁니다.

xyzyeahyeah6653's profile image
xyzyeahyeah6653

asked

Ask a question