메뉴 건너뛰기

app

binary_search.

박영식2003.11.05 19:51조회 수 3233댓글 0

    • 글자 크기
int CRandom::binarySearch(int bs[], int n, int target)
{
        int first(0); int last(n-1); int mid;
        while(first<=last)
        {
                cnt++;
                mid = (first+last)/2;
                if(target==bs[mid])
/*                        if(a==-1){
                                printf("dd");
                                return (mid-(100-a));}
                        else*/
                                return mid;
                else if(target<bs[mid])
                        last=mid-1;
                else
                        first=mid+1;
        }
        return -1;
}
박영식 (비회원)
    • 글자 크기
interpolationSearch (by 박영식) 조합 구하기. (by 박영식)

댓글 달기

박영식
2003.11.05 조회 17486
박영식
2003.11.05 조회 2274
박영식
2003.11.05 조회 2450
박영식
2003.11.05 조회 2169
박영식
2003.11.05 조회 2192
박영식
2003.11.05 조회 3233
박영식
2002.06.14 조회 2574
박영식
2002.04.18 조회 3367
박영식
2002.04.18 조회 3235
이전 1 ... 5 6 7 8 9 10 11 12 13 14 다음
첨부 (0)
위로