
数据结构
文章平均质量分 72
hwh212
这个作者很懒,什么都没留下…
展开
-
【数据结构】栈与队列
ADT栈---------------#include#include//Stack CreatStack(MAX_STACK_SIZE)#define MAX_STACK_SIZE 10typedef struct { int key;} element;element stack[MAX_STACK_SIZE];int top = -1;void Add(int原创 2013-04-28 21:47:18 · 584 阅读 · 0 评论 -
【数据结构】malloc简易用法
---------------#include#includevoid main(){ int *pi; float *pf; pi = (int*)malloc(sizeof(int)); pf = (float*)malloc(sizeof(float)); *pi = 1024; *pf = 3.14; printf("an integer = %d, a float原创 2013-04-28 22:11:03 · 2737 阅读 · 0 评论 -
【数据结构】typedef struct 和 struct在链表中的应用
(1) struct{ int x; int y; }test1; 定义了 结构 test1,test1.x 和 test1.y 可以在语句里用了。(2) struct test {int x; int y; }test1; 定义了 结构 test1,test1.x 和 test1.y 可以在语句里用了。与 1 比,1里面省写 了 test(3) typedef struct原创 2013-05-04 19:39:09 · 2303 阅读 · 3 评论