线性表顺序(动态数组实现)

//线性表的顺序表示指的是:用一组地址连续的存储单元依次存储线性表的数据元素.//只要确定了存储线性表的起始位置,线性表中任一数据元素都可随机存取,//所以线性表的顺序表存储结构是一种随机存取的存储结构.#define OVERFLOW -1#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0#define NULL 0#define LIST_INIT_SIZE 100 //线性表存储空间的初始分配量#define LISTINCREMENT 10 //线性表存储空间的分配增量#include<iostream>#...
数据结构 | 2011-10-09 13:39 | 阅读 505 次 | 评论 0 条

线性表顺序(静态数组实现)

#define MAXSIZE 100#define ERROR 0#include<iostream>#include<cstdio>using namespace std;typedef int ElemType; typedef struct { ElemType elem[MAXSIZE]; int length; }SqList;void InitList(SqList &amp;L)//初始化操作,将线性表置空{ L.length = 0; } void CreatList(SqList &amp;L,int n)//建立一个...
数据结构 | 2011-10-09 13:38 | 阅读 591 次 | 评论 0 条

线性链表基本操作实现

//函数结果状态#define TRUE 1#define FALSE 0#define OK 1#define ERROR 0#define INFEASIBLE -1#define NULL 0#define OVERFLOW -2#include<iostream>#include<stdio.h>#include<malloc.h>using namespace std;typedef int Status;//Staus是函数的类型,其值是函数结果typedef int DateType; //DateType可以使相应任何的数据类型如int、float、char//结点类型定...
数据结构 | 2011-10-09 13:36 | 阅读 515 次 | 评论 0 条
文章归档
最新评论