![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Sorting and Searching
greatbear_us
这个作者很懒,什么都没留下…
展开
-
Binary Search Implementation
#include #include int binarySearch(); int binarySearchRecursive(int a[], int start, int end, int target); int main() { int a[5] = {2,8,9,13,21}; int pos1 = binarySearch(a, 5, 6); printf原创 2013-05-11 09:28:01 · 329 阅读 · 0 评论 -
Merge Sort
#include #include //To save space, only one temp array is used void mergeArray(int a[], int first, int mid, int last, int temp[]){ int i = first, j = mid + 1; int m = mid, n = last; int原创 2013-05-13 03:28:24 · 373 阅读 · 0 评论 -
Quick Sort
#include #include int adjustArray(int s[], int l, int r){ int i = l, j = r; int x = s[i]; while(i < j){ while(i x){ j--; } if(i < j){ s[原创 2013-05-13 03:11:32 · 383 阅读 · 0 评论