随笔分类 - 数据结构
摘要:```c /* 顺序栈是指利用顺序存储结构实现的栈,即利用一组地址连续的存储单元依次存放 自栈底到栈顶的数据元素,同时附设指针top指示栈顶元素在顺序表中的位置。 做法: 以 top=0 表示空栈,另外设指针 base 指示栈底元素在顺序栈中的位置。 当 top 与 base 的值相等时,表示空栈。
阅读全文
摘要:```c #include #include //数据结点 typedef struct binode { int data; struct binode* next;//指向下一个 struct binode* prev;//指向前一个 }BiNode; //头结点 typedef struct
阅读全文
摘要:```c #include #include //创建一个单链表 struct LNode //结点 { int data; //数据 struct LNode* next; //指向下个结点的指针 }; void List_Print(struct LNode* p)//自定义列表打印函数 { w
阅读全文