C언어 이진탐색 알고리즘
#include int calc(int *arr, int arrSize, int find){ int start = 0; int end = arrSize-1; int calcCount = 0; int center; while(start arr[center]){ start = center+1; }else { end = center-1; } } } return 0; } int main(void) { int myArr[10] = {1,3,5,6,9,11,13,24,32}; int arrLength = sizeof(myArr) / sizeof(int); calc(myArr, arrLength, 11); return 0; }
2021. 6. 17.