随笔分类 -  数据结构实例

摘要:#include <stdio.h> #include "queue.h" int main(void) { SqQueue qu; ElemType e; InitQueue(&qu); printf("栈%s/n", (QueueEmpty(qu) == 0 ? "空" : "不空")); printf("a进栈/n"); EnQueue(&qu, 'a'); printf("b进栈/n"); EnQueue(&qu, 阅读全文
posted @ 2010-10-30 22:58 云说风轻 阅读(347) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include "stack.h" int main(void) { SqStack st; ElemType e; InitStack(&st); printf("栈%s/n", (StackEmpty(st) == 0 ? "空" : "不空")); printf("a进栈/n"); Push(&st, 'a'); printf("b进栈/n"); Push(&st, 'b 阅读全文
posted @ 2010-10-30 16:28 云说风轻 阅读(291) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include "Dlink.h" int main(void) { DLink *L; int i = 0; ElemType e = '0'; //认真体会C语言拷贝传递的思想 InitList(&L); InsElem(L, 'a', 1); InsElem(L, 'b', 2); InsElem(L, 'c', 3); InsElem(L, 'd', 4); InsElem(L, 'e', 5); pri... 阅读全文
posted @ 2010-10-27 07:33 云说风轻 阅读(351) 评论(0) 推荐(0)
摘要:#include <stdio.h> #include "SqList.h" int main(void) { int num = 0; char e; SqList L; InitList(&L); //插入元素 InsElem(&L, 'a', 1); InsElem(&L, 'b', 2); InsElem(&L, 'c', 3); InsElem(&L, 'd', 4); InsElem(&L, 'e', 5); InsElem 阅读全文
posted @ 2010-10-27 07:18 云说风轻 阅读(220) 评论(0) 推荐(0)