BOOL Bin_search (const int *PRE, int low, int. high, const int key) {When (Low < High) //Note { int mid = L ow + ((high-low) >>1); if (pre[mid] = = key) return true; else if (Pre[mid] < key) Low = mid + 1; else high = mid; Note } return false;} BOOL Bin_search (const int *PRE, int low, int. high, const int key) { high--; while (low <= high) { int mid = low + ((high-low) >>1); if (pre[mid] = = key) return true; else if (Pre[mid] < key) Low = mid + 1; else High = mid + 1; } return false;}
Copyright notice: I feel like I'm doing a good job. I hope you can move your mouse and keyboard for me to order a praise or give me a comment, under the Grateful!_____________________________________________________ __ Welcome reprint, in the hope that you reprint at the same time, add the original address, thank you with
Two ways to find binary points