链表的归并排序
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
using namespace std;
struct ListNode
{
ListNode* next;
int value;
};
bool List_insert(ListNode ** phead, int x, int i)
{
//空指针
if (phead == NULL)
{
return 0;
}
ListNode * pCurrent(NULL);
//头插入
if (i==1)
{
pCurrent = *phead;
ListNode * pNew = new ListNode;
pNew->value = x;
pNew->next = pCurrent;
*phead = pNew;