Chinaunix首页 | 论坛 | 博客
  • 博客访问: 327381
  • 博文数量: 96
  • 博客积分: 2041
  • 博客等级: 大尉
  • 技术积分: 1080
  • 用 户 组: 普通用户
  • 注册时间: 2012-01-20 14:08
文章分类

全部博文(96)

文章存档

2015年(2)

2013年(1)

2012年(93)

分类: Delphi

2012-03-10 21:13:52


#define Max 20
typedef int datatype ;
typedef struct
{
 datatype data[Max] ;
 int front ,rear ;
}SeqQueue ;
SeqQueue * Init_SeqQueue()
{
 SeqQueue * q ;
 q = (SeqQueue *)malloc(sizeof(SeqQueue)) ;//忘了写这句
 q->front = q->rear = -1 ;
 return q ;
}
void Push_SeqQueue(SeqQueue * q,datatype x)
{
 q->rear ++ ;
 q->data[q->rear] = x ;
}
void Push_SeqQueue(SeqQueue *q , datatype *x)
{
 q->front ++ ;
 *x = q->data[q->front] ;
}

 
阅读(971) | 评论(0) | 转发(0) |
0

上一篇:LinkStack

下一篇:三分之一效应

给主人留下些什么吧!~~