斗----自尊、自强、自信

蜗牛慢慢爬,只要不停下来就好~~

博客园 首页 新随笔 联系 订阅 管理

void Reverse_merge(pLinkList la,pLinkList lb,struct LinkList ** lc)
{
 pLinkList current = NULL;
 while ( la && lb )
 {
  
  if ( la->value < lb->value )
  {
   *lc = la;
   la = la->next;
   (*lc)->next = current;
   current = *lc;
  }
  else
  {
   *lc = lb;
   lb = lb->next;
   (*lc)->next = current;
   current = *lc;
  }
 }
 while (la)
 {
  *lc = la;
  la = la->next;
  (*lc)->next = current;
  current = *lc;
 }
 while (lb)
 {
  *lc = lb;
  lb = lb->next;
  (*lc)->next = current;
  current = *lc;
 }
}
类似于归并排序中的一种合并方法

posted on 2007-12-17 12:22  a斗  阅读(810)  评论(0编辑  收藏  举报