linklist.h
来自「学生运动会成绩数据库 学生运动会成绩数据库系统记录某校运动会上全部运动项目」· C头文件 代码 · 共 44 行
H
44 行
#ifndef _Linklist_H
#define _Linklist_H
#include <iostream>
// 节点类型
template <typename T>
struct Node
{
T data;
Node<T> *next;
};
// 链表
template <typename T>
class Linklist
{
public:
Linklist(); // 链表构造函数
~Linklist(); // 析构函数
void Insert(int i, const T& x); // 插入元素
void Delete(int i); //删除元素
int Find(const T& x) const; // 查找元素
T& Get(int i) ;// 获取元素
bool Empty() const;// 判断链表是否为空
void Print() const; // 打印
int Length() const;// 长度
Node<T> * Getfirst() const;//取头结点
private:
Node<T>* first;//头接点
int length;//保存链表的长度
};
#ifndef Link_List_h
#include "Link_List.h"
#endif //Link_List_h
#endif //_Linklist_h
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?