代码搜索结果

找到约 10,000 项符合 9 的代码

9_6.txt

int QKPass(RecordType r[],int left,int right) /*对记录数组r 中的r[left]至r[right]部分进行一趟排序,并得到基准的位置,使得排序后的结果满足其之后(前)的记录的关键字均不小于(大于)于基准记录*/ { RecordType x; int low,high; x= r[left]; /* 选择

9_10.txt

void HeapSort(RecordType r[],int length) /* 对r[1..n]进行堆排序,执行本算法后,r中记录按关键字由大到小有序排列 */ { int i,n; RecordType b; crt_heap(r, length); n= length; for ( i=n ; i>= 2; --i) { b=r[1];

9_13.txt

void MergeSort ( RecordType r[], int n ) /* 对记录数组r[1..n]做归并排序 */ { MSort ( r, 1, n, r ); }

9_7.txt

void SelectSort(RecordType r[], int length) /*对记录数组r做简单选择排序,length为数组的长度*/ { int i,j,k; int n; RecordType x; n=length; for ( i=1 ; i

9_5.txt

void QKSort(RecordType r[],int low, int high ) /*对记录数组r[low..high]用快速排序算法进行排序*/ { int pos; if(low

9_11.txt

void Merge(RecordType r1[], int low, int mid, int high, RecordType r2[]) /* 已知r1[low..mid]和r1[mid+1..high]分别按关键字有序排列,将它们合并成一个有序序列,存放在r2[low..high] */ { int i,j,k; i=low; j=mid+1; k=l

9_12.txt

void MSort(RecordType r1[], int low, int high, RecordType r3[]) /* r1[low..high]经过排序后放在r3[low..high]中,r2[low..high]为辅助空间 */ { int mid; RecordType r2[20]; if ( low==high ) r3[low

9_1.txt

void InsSort(RecordType r[], int length) /* 对记录数组r做直接插入排序,length为数组中待排序记录的数目*/ { int i,j; for (i=2; i

9_2.txt

void BinSort (RecordType r[], int length) /*对记录数组r进行折半插入排序,length为数组的长度*/ { int i,j; RecordType x; int low,high,mid; for ( i=2; i

2_9.txt

Node *Locate( LinkList L,ElemType key) /*在带头结点的单链表L中查找其结点值等于key的结点,若找到则返回该结点的位置p,否则返回NULL*/ { Node *p; p=L->next; /*从表中第一个结点开始 */ while (p!=NULL) { if (p->data!=key) p=p->next;