数据结构
fly_lhw
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
链表的创建和遍历
/*链表的创建和建立*/1.定义一个节点的数据类型typedef struct Node{ int data; struct Node *pNext;}NODE, *PNODE;2.在主函数里创建链表并对其进行遍历int main(void){ PNODE pHead = NULL; //struct N原创 2014-03-21 03:02:36 · 590 阅读 · 0 评论 -
循环队列
一、定义队列结构体//typedef struct Queue{ int *pArray; int front; int rear;}QUEUE, *PQUEUE;//二、初始化队列&&void init_queue(PQUEUE pQueue){ pQueue->pArray = (int *)malloc(sizeof(int) * 10原创 2014-03-23 21:34:42 · 391 阅读 · 0 评论 -
栈的初始化、压栈,栈的遍历、出栈、清空栈
一、栈的初始化//////void init_stack(PSTACK pStack){ pStack->pTop = (PNODE)malloc(sizeof(NODE)); if (pStack->pTop == NULL) { printf("malloc failed!\n"); exit(-1);原创 2014-03-23 01:45:02 · 1939 阅读 · 0 评论 -
判断链表是否为空、求链表长度、插入新节点、删除节点、链表排序
一、判断链表是否为空//startbool is_empty(PNODE pHead){ if (pHead->pNext == NULL) { return true; } else { return false; } }//end二、求链表长度//startint length_list(PNODE pHead){原创 2014-03-22 03:06:41 · 1508 阅读 · 0 评论
分享