随笔分类 - 数据结构
摘要:1 package com.iloveu.xxx; 2 3 public class MergeSort { 4 5 static final int SIZE = 15; 6 7 static void mergeOne(int a[],int b[],int n,int len) 8 { 9 i...
阅读全文
摘要:$s){ if($begin > $mid-1){ return false; } //中间项比$s大,去mid左边找 $re = binary_search($arr,$s,$begin,$mid-1); } else{ if($mid+1 > $end){ ...
阅读全文
摘要:1 #include 2 #include 3 4 int binsearch(int x,int v[],int n);//函数声明 5 6 int main() 7 { 8 int arr[]={1,2,3,4,5,6,7,8,9,10}; 9 int 结果,num;10...
阅读全文
摘要:1 #include 2 #include 3 //顺序查找基本思想:从线性表的一端开始,逐个检查关键字是否满足给定的条件 4 int SequentialSearch(int *a,int n,int x); 5 6 int main(void) 7 { 8 int m[10]={2,...
阅读全文
摘要:1 #include 2 #include 3 void BubbleSort(int *a,int n); 4 5 int main(void)//入口函数,整型,无参数 6 { 7 int k; 8 int a[10]={2,4,6,8,0,1,3,5,7,9}; 9 ...
阅读全文