建立源文件SeqList.cpp:#define_CRT_SECURE_NO_WARNINGS1
#include"SeqList.h"
intmain()
{
Test();
system("pause");
return0;
}建立源文件SeqList.h:#ifndef__SEQLIST_H__
#define__SEQLIST_H__
#include<iostream>
usingnamespacestd;
#include<assert.h>
..
分类:
编程语言 时间:
2016-03-02 20:15:47
阅读次数:
251
顺序表是基本的数据结构,创建Seqlist类,主要包括类的默认成员函数(构造函数、析构函数、赋值运算符重载),顺序表的基本功能实现。
//顺序表
typedefintDataType;
classSeqlist
{
public:
Seqlist()//无参构造函数
:_array(NULL)
,_size(0)
,_capacity(0)
{}
~Seqlist()//..
分类:
编程语言 时间:
2016-02-29 23:23:27
阅读次数:
315
线性表 顺序表示 struct SeqList{ int n; int MAXNUM; DataType *element; } typedef struct SeqList *PSeqList; - 不适合随机插入和删除- 节省了空间但是操作的时间复杂度增加了 链接表示 数据域 指针域 struc
分类:
其他好文 时间:
2016-02-28 22:53:50
阅读次数:
135
"Seq_S.h"#ifndef__SEQ_LIST_H__#define__SEQ_LIST_H__#defineMAX100#include<stdio.h>#include<assert.h>#include<string.h>typedefintDataType;typedefstructSeqList{ DataTypearr[MAX]; intsize;}SeqList,*pSeqList;voidInitSeqList(pSeqListpSeq);//初始..
分类:
其他好文 时间:
2016-02-27 01:08:14
阅读次数:
251
顺序表: 声明:struct seqlist { Int last; Int data[12]; }seq,*seqlist; 初始化 seqlist init_seqlist() { seqlist sl = malloc(sizeof(seq)); sl->last =-1;//标记位,用于判断
分类:
其他好文 时间:
2016-02-21 14:22:03
阅读次数:
158
//SeqList.h
#ifndef__SEQLIST_H__
#define__SEQLIST_H__
#include<string.h>
#include<assert.h>
#include<stdlib.h>
typedefintDataType;
typedefstructSeqList
{
DataType*array;
size_tsize;
DataTypecapacity;//容量
}SeqList,*pSeqList;
voidIni..
分类:
其他好文 时间:
2016-02-21 06:45:59
阅读次数:
281
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<string.h>
#include<malloc.h>
typedefintDateType;
typedefstructSeqList
{
DateType*arr;
size_tcapacility;
size_tsize;
}SeqList;
//创建空间
voidCheckCapa(SeqList..
分类:
编程语言 时间:
2016-02-20 01:54:44
阅读次数:
267
#define_CRT_SECURE_NO_WARNINGS1
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<string.h>
#defineMAXSIZE1000
typedefintDateType;
typedefstructSeqList
{
DateTypearr[MAXSIZE];
size_tsize;
}SeqList;
//打印静态顺序表..
分类:
编程语言 时间:
2016-02-19 01:47:18
阅读次数:
274
#define_CRT_SECURE_NO_WARNINGS#include<stdio.h>#include<assert.h>#include<string.h>#defineMAX_SIZE5typedefintDataType;typedefstructSeqList{DataTypearray[MAX_SIZE];size_tsize;}SeqList;打印顺序表voidPrintfSeqList(SeqList*pSeq){assert(pSeq);i..
分类:
其他好文 时间:
2016-02-18 20:00:52
阅读次数:
186
#define_CRT_SECURE_NO_WARNINGS1
#include<stdio.h>
#include<assert.h>
#include<stdlib.h>
#include<string.h>
#defineMAX_SIZE5
typedefintDataType;
typedefstructSeqList
{
size_tsize;
DataTypearray[MAX_SIZE];
}SeqList;
//冒泡排序
//v..
分类:
编程语言 时间:
2016-01-18 20:59:01
阅读次数:
302