This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Divide and conquer search for sorted integer array. | |
| * Pre: Takes array pointer | |
| * Integer to find | |
| * Last index of array | |
| * Initial of array | |
| * Return: Index of the array | |
| */ | |
| int divideAndConquer(int* arr, int toFind, int lastIndex, int initialIndex) { | |
| int mid = initialIndex + ((lastIndex - initialIndex) / 2); |