Tag: 链表’
链表的链式表示和实现(C++模板类实现)
- by Hector
[CODE=cplusplus]
// 名 称 (Unit Name) : 链表List.h 头文件
// 支 持 (Support) : http://www.ourys.com
#ifndef _LIST_H
#define _LIST_H
template
class List;
/*———— 用友元类做节点 —
线性表链式表示(c语言版)
- by Hector
[CODE=cplusplus]
//vs2005,vc6.0,gcc测试均通过
/*———- Link.H —————*/
typedef int DataType; /*定义节点数据类型*/
typedef struct tagLink
{
DataType data;
struct tagLink* next; //指向该结构体的指针
链表的顺序表示和实现(C++模板类实现)
- by Hector
[CODE=cplusplus]
/*List.h*/
#ifndef _LIST_H
#define _LIST_H
#define LIST_INIT_SIZE 100
#define LISTINCREMENT 10
template
class List
{
public:
List(); //构造函数:构造一个空的线性表
//~List(); //析构函数
void