![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
soul519
这个作者很懒,什么都没留下…
展开
-
03链表的创建、插入、删除、遍历、排序
# include # include # include typedef struct Node{ int data; //数据域 struct Node * pNext; //指针域}NODE, *PNODE; //NODE等价于struct Node PNODE等价于struct Node *//函数声明PNODE create_list(void); //创建原创 2013-10-19 14:33:08 · 687 阅读 · 0 评论 -
07-1链式二叉树,前序、中序、后序遍历
# include # include struct BTNode{ char data; struct BTNode * pLchild; //p是指针 L是左 child是孩子 struct BTNode * pRchild;};void PostTraverseBTree(struct BTNode * pT);struct BTNode * CreateBTree(原创 2013-10-19 15:15:42 · 575 阅读 · 0 评论 -
05 -1队列-链式队列
/* 2008年3月26日16:31:56 链式队列*/# include using namespace std;typedef struct node{ int data; struct node *pNext;}NODE, *PNODE;class Queue{public: Queue() { this->pHead = this->pTail =原创 2013-10-19 15:03:28 · 608 阅读 · 0 评论 -
04栈的压栈、出栈、遍历
# include # include # include typedef struct Node{ int data; struct Node * pNext;}NODE, * PNODE;typedef struct Stack{ PNODE pTop; PNODE pBottom;}STACK, * PSTACK; //PSTACK 等价于 struct STA原创 2013-10-19 14:40:41 · 742 阅读 · 0 评论 -
05-2循环队列
# include # include typedef struct Queue{ int * pBase; int front; int rear;}QUEUE; void init(QUEUE *);bool en_queue(QUEUE *, int val); //入队void traverse_queue(QUEUE *);bool full_queue(Q原创 2013-10-19 15:11:27 · 621 阅读 · 0 评论 -
02数组操作
# include # include //包含了malloc函数# include //包含了exit函数//定义了一个数据类型,该数据类型的名字叫做struct Arr, 该数据类型含有三个成员,分别是pBase, len, cntstruct Arr{ int * pBase; //存储的是数组第一个元素的地址 int len; //数组所能容纳的最大元素的个数 i原创 2013-10-19 14:30:27 · 604 阅读 · 0 评论 -
01数据结构概述(郝斌数据结构)
数据结构概述(教材选用严蔚敏、吴伟民,该书程序是伪算法具体的程序是高一凡,西电的,大牛,只有程序。还有一本书,台湾的黄国瑜自己写的只有思路,程序是另外一个合作的清华的写的,可惜很多错的。)学完数据结构之后会对面向过程的函数有一个更深的了解 定义 我们如何把现实中大量而复杂的问题以特定的数据类型(单个数据怎样存储?)和特定的存储结构(个体的关系)保存到主存原创 2013-10-19 15:01:54 · 1552 阅读 · 1 评论 -
链表逆序
设链表节点为[cpp] view plaincopyprint?typedef struct tagListNode{ int data; struct tagListNode* next; }ListNode, *List; typedef struct tagListNode{ int data; struct转载 2013-10-19 14:23:53 · 544 阅读 · 0 评论 -
06递归-汉诺塔
# include void hannuota(int n, char A, char B, char C){/* 如果是1个盘子 直接将A柱子上的盘子从A移到C 否则 先将A柱子上的n-1个盘子借助C移到B 直接将A柱子上的盘子从A移到C 最后将B柱子上的n-1个盘子借助A移到C*/ if (1 == n) { printf("将编号为%d的盘子直接从%c柱原创 2013-10-19 15:13:02 · 547 阅读 · 0 评论 -
08-1排序 快速排序
# include int FindPos(int * a, int low, int high);void QuickSort(int * a, int low, int high);int main(void){ int a[6] = {-2, 1, 0, -985, 4, -93}; int i; QuickSort(a, 0, 5); //第二个参数表示第一个元素的下标原创 2013-10-19 15:18:48 · 579 阅读 · 0 评论