文章列表
链式队列实现起来很简单。
唯一需要注意的是:
在入队和出队时,需要分别处理一下队头和队尾为空的情况。
/*
** File name: LinkQueue.h
** Author: ZhouFeng
** Date: 2012/03/28
*/
#ifndef LINK_QUEUE_H
#define LINK_QUEUE_H
#define BOOL int
#define FALSE 0
#define TRUE 1
#define ERROR 0
#define SUCCESS 1
typedef int EleType;
typedef struc ...
- 2012-03-28 23:35
- 浏览 601
- 评论(0)
看完复仇看了看队列。花了半小时来编写、调试。写完博客再去温习下枪火
/*
** File name: SeqQueue.h
** Author: ZhouFeng
** Date: 2012/03/27
*/
#ifndef SEQ_QUEUE_H
#define SEQ_QUEUE_H
#define BOOL int
#define ERROR 0
#define SUCCESS 1
#define TRUE 1
#define FALSE 0
#define MAX_SIZE 100
typedef int EleType;
typedef struct SeqQueue
{
...
- 2012-03-28 00:37
- 浏览 843
- 评论(0)
/*
** File name: SeqStack.h
** Author: ZhouFeng
** Date: 2012/03/26
*/
#ifndef SEQ_STACK_H
#define SEQ_STACK_H
#define MAX_SIZE 100
#define ERROR 0
#define SUCCESS 1
#define TRUE 1
#define FALSE 0
typedef int BOOL;
typedef int EleType;
typedef struct SeqStack
{
EleType _seqSta ...
- 2012-03-26 22:56
- 浏览 1027
- 评论(0)
/*
** File name: SeqList.h
** Author: ZhouFeng
** Date: 2012/03/25
*/
#ifndef SEQ_LIST_H
#define SEQ_LIST_H
#define MAX_SIZE 100
#define ERROR 0
#define SUCCESS 1
typedef int EleType;
typedef struct SeqList
{
EleType _seqList[MAX_SIZE];
int length;
}SeqList;
void InitSe ...
- 2012-03-25 23:50
- 浏览 550
- 评论(0)