-
최적화 문제 결정 문제로 바꿔 풀기 #알고리즘문제해결전략 ch.12Computer_Science/Algorithm 2018. 12. 28. 23:02
이 글은 '알고리즘 문제해결전략' (저자 구종만 , 출판사 인사이트)의 12번째 챕터(최적화 문제 결정 문제로 바꿔 풀기)의 내용을 정리한 글입니다. (https://www.aladin.co.kr/shop/wproduct.aspx?ItemId=21089176) 알고리즘을 설계할 때, 어느 한 지점, 조합에 대해 대답하는 알고리즘보다 임의로 설정한 구간에 대해 대답하는 알고리즘을 설계하는 것이 더 쉬울 때가 있습니다. 예를 들어, 술게임(...)에서 많이 하는 1에서 50사이의 숫자 맞추기 게임은 두가지 버전이 있을 수 있을 것입니다 . 1. 어느 한 숫자를 부르면 그 숫자가 정답인지 아닌지만 알려주는 방식 2. 어느 한 숫자를 부르면 정답인 숫자가 더 큰지 작은지 알려주는 방식 당연히 2번 방식의 게임이..