메뉴 건너뛰기

app

binary_search.

박영식2003.11.05 19:51조회 수 3238댓글 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;
}
박영식 (비회원)
    • 글자 크기
[php] 원격지 파일 저장하기 (by 박영식) 피보나치 수열 (by 박영식)

댓글 달기

박영식
2008.07.22 조회 3176
박영식
2003.11.05 조회 3238
박영식
2002.04.18 조회 3247
박영식
2002.04.18 조회 3377
박영식
2003.12.19 조회 3460
이전 1 ... 5 6 7 8 9 10 11 12 13 14다음
첨부 (0)
위로