随笔分类 - 数据结构实例
摘要:#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,
阅读全文
摘要:#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
阅读全文
摘要:#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...
阅读全文
摘要:#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
阅读全文

浙公网安备 33010602011771号