15、 #define int KeyType //定义KeyType 为int型  typedef struct node{    KeyType key; //关键字域    OtherInfoType info; //其它信息域,    struct node * next; //链表中指针域   }RecNode; //记录结点类型  typedef RecNode * LinkList ; //单链表用LinkList表示  void selectsort(linklist head)   {RecNode *p,*q,*s;    if(head-next)(head-next-next)     {p=head-next;//p指向当前已排好序最大元素的前趋      while (p-next)       {q=p-next;s=p;        while(q)         {if (q-keys-key) s=q;          q=q-next;         }//endwhile        交换s结点和p结点的数据;        p=p-next;       }//endwhile     }//endif   }//endsort 16、void BuildHeap(seqlist *R)   {    KeyType key;

文档评论(0)

1亿VIP精品文档

相关文档