c数据结构的问题,高手帮忙

来源:百度知道 编辑:UC知道 时间:2024/05/22 22:06:12
谁有链表排序的号算法阿?

// linked list.cpp : Defines the entry point for the console application.
//

#include <stdio.h>
#include <iostream.h>
enum Error_code {success, overflow, underflow, range_error};
template <class Node_entry>
struct Node
{
//data members
Node_entry entry;
Node<Node_entry> *next;
//constructors
Node();
Node(Node_entry item, Node<Node_entry> *link = NULL);
};
template <class Node_entry>
Node<Node_entry>::Node()
{
next = NULL;
}

template <class Node_entry>
Node<Node_entry>::Node(Node_entry item, Node<Node_entry> *link)
{
entry = item;
next = link;
}

template<class List_entry>
class List
{
public:
~List();
List();
List(const List<List_entry> ©);
void operator=(const List<List_entry> ©);
Error_code insert(lon