目的:通过实际操作单链表,掌握单链表的链式储存结构以及验证单链表及其操作的实现并进一步理解算法与程序的关系。
内容:用尾插法建立带头结点的单链表并对已创建的单链表实现插入、删除、查找等基本操作。
#include<iostream>
using namespace std;
template<class T>
struct Node
{
T data;
Node<T> *next;
};
template<class T>
class Student{
public:
Student();
Student(T a[],int n);
~Student();
T Get(int i);
int locate(T x);