diff --git a/The Last Algorithms Course You'll Need/4. Binary Search.c b/The Last Algorithms Course You'll Need/4. Binary Search.c index b15f400..76ebc11 100644 --- a/The Last Algorithms Course You'll Need/4. Binary Search.c +++ b/The Last Algorithms Course You'll Need/4. Binary Search.c @@ -2,6 +2,10 @@ #define SIZE 4096 +// The complexity is O(log n) +// because we always half the amount +// like N/2 -> N/4 -> N/8 ... N/(2^k) which equals log n + int binary_search(int array[], int size, int offset, int value) { int pivot = size / 2;