⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 insertsort.h

📁 对链表进行排序 应用了多种排序方法 对其进行比较 有自己的详细的时间函数
💻 H
字号:
#include"Node.h"
using namespace std;
pNode insert (pNode L, pNode pNew)
{
  if (L == NULL)
    return pNew;
  if (pNew->data < L->data)
  {
      pNew->next = L;
      return pNew;
  }
  L->next = insert (L->next, pNew);
  return L;
}

pNode insertsort (pNode L)
{
  if (L == NULL) //空链,无须排序,返回.(递归的跳出条件)
    return L;
  pNode tail = L->next;
  L->next = NULL;
  return insert (insertsort(tail), L);
}



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -