2012年5月11日

栈的实现-链表

摘要: 声明:#include "stdio.h"#include "stdlib.h"//单链表结点struct Node;//指向结点的指针类型typedef struct Node *PNode;typedef int DataType;struct Node { DataType info; PNode link;};//链接栈类型定义struct LinkStack { //指向栈顶结点 PNode top;};//链接栈类型的指针类型typedef struct LinkStack * PLinkStack;//创建一个空链栈PLinkStack c 阅读全文

posted @ 2012-05-11 11:13 yucong 阅读(188) 评论(0) 推荐(0)

栈的实现-顺序表

摘要: 声明:#include "stdio.h"#include "stdlib.h"typedef int DataType;struct SeqStack { int MAXNUM; //t<MAXNUM,指示栈顶位置,而不是元素个数; int t; DataType *s;};//顺序栈类型的指针类型typedef struct SeqStack * PSeqStack;//创建空栈PSeqStack createEmptyStack_seq(int m){ PSeqStack pStack=(PSeqStack)malloc(sizeof(str 阅读全文

posted @ 2012-05-11 10:22 yucong 阅读(224) 评论(0) 推荐(0)

导航