![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
文章平均质量分 74
bo_1997_2017
既然选择了,就坚定的学下去。
展开
-
数据结构 P46-47 算法实现 顺序栈的基本操作
#include using namespace std; #define STACK_INIT_SIZE 100 //初始存储容量 #define STACKINCERMENT 10 //存储空间增量 struct SqStack //顺序栈的定义 { int *base; /原创 2017-10-20 09:40:54 · 502 阅读 · 0 评论 -
数据结构 P62-62 算法实现 单链队列的创建及基本操作
#include using namespace std; typedef int QElemType; struct QNode //创建节点结构体 { QElemType data; QNode *next; }; struct linkqueue //创建链队列结构体 { QNode *front; //原创 2017-10-24 19:57:10 · 374 阅读 · 0 评论 -
数据结构 P49 栈的应用举例-括号匹配的检验
#include #include using namespace std; #define STACK_INIT_SIZE 100 //初始存储容量 #define STACKINCERMENT 10 //存储空间增量 struct SqStack //顺序栈的定义 { char *base;原创 2017-10-21 21:49:35 · 307 阅读 · 0 评论 -
数据结构 P50 算法实现 栈的应用-行编辑程序
#include #include using namespace std; #define STACK_INIT_SIZE 100 //初始存储容量 #define STACKINCERMENT 10 //存储空间增量 struct SqStack //顺序栈的定义 { char *base;原创 2017-10-22 09:32:10 · 467 阅读 · 0 评论 -
数据结构 P48 算法实现 栈的应用举例-数制转换
#include using namespace std; #define STACK_INIT_SIZE 100 //初始存储容量 #define STACKINCERMENT 10 //存储空间增量 struct SqStack //顺序栈的定义 { int *base; //栈原创 2017-10-20 21:21:56 · 783 阅读 · 0 评论 -
数据结构 P35 算法实现 循环链表的创建与查找
#include using namespace std; struct node //创建节点 { int date; node *next; }; int main() { node *head; //创建头结点 head=NULL; int x=1,y1=0; //y1为判断链表现有长度的参数 n原创 2017-10-08 11:51:41 · 343 阅读 · 0 评论 -
数据结构 P16 算法实现
冒泡排序-先将最大的数放在最后面 ,将整数序列重新排列成自小至大有序的整数序列原创 2017-09-18 20:49:45 · 463 阅读 · 0 评论 -
数据结构 P20 算法实现 —A=AUB和归并排序
for(int j=0;j<ASIZE+n;++j) //B集合的元素依次与A集合的元素比较 { if(B[i]!=A[j]) //若不同则系数m加一 ++m; if(m==ASIZE+n) //若与A集合所有的元素都不相同则将B集合中的该元素添加到A集合原创 2017-09-19 20:31:23 · 779 阅读 · 0 评论 -
数据结构 P22-24 算法实现 线性表的插入与删除
/*线性表的插入*/ #include using namespace std; #define LIST_INIT_SIZE 100 //线性表的初始分配量 #define LISTINCREMENT 10 //线性表分配空间的增量 struct SqList //定义线性表结构体 { i原创 2017-09-21 20:09:02 · 2021 阅读 · 0 评论 -
数据结构 p25-26 算法实现 线性表的查找与归并排序2
/*线性表的查找 2.6*/ #include using namespace std; #define SIZE 6 int main() { int a[SIZE]={9,2,8,4,5,6}; int elem,i,j=0; cin>>elem; for(i=0;i { if (elem==a[i]) { cout break; } } w原创 2017-09-25 16:39:54 · 595 阅读 · 0 评论 -
数据结构 P28-29 算法实现 线性表的链式存储结构——链表的查找、插入与删除
/*链表的创建与查找*/ #include using namespace std; struct node { int date; //数据域 node *next; //指针域 }; int main() { int x=1; node *head,*p; //定义头结点和节点 head= new原创 2017-09-29 19:28:31 · 627 阅读 · 0 评论 -
数据结构 P30 算法实现 链表的头插法 尾插法
#include #define OK 1 #define ERROR 0 int a,b; using namespace std; struct node { int date; node *next; }; class List { node *head; public: List() {head=NULL;}原创 2017-09-30 16:05:00 · 298 阅读 · 0 评论 -
数据结构 P31 算法实现 有序链表合并为有序链表
/*有序链表的合并 —算法2.12*/ #include using namespace std; struct node //创建节点 { int date; node *next; }; class list //创建链表类 { public: node *head,*s,*p; public: list(){hea原创 2017-10-05 20:59:58 · 326 阅读 · 0 评论 -
数据结构 P35 算法实现 双向循环链表的创建
#include using namespace std; struct node //双向链表的节点 { int date; node *next; //指向后一个节点 node *prior; //指向前一个节点 }; int main() { node *head,*s,*p,*q;//head—头结点 s—新节点 p—创建链表 q—打原创 2017-10-10 11:09:45 · 465 阅读 · 0 评论 -
数据结构 P36-37 算法实现 双向循环链表的插入与删除
/*双向链表的插入与删除*/ #include using namespace std; struct node //双向链表的节点 { int date; node *next; //指向后一个节点 node *prior;原创 2017-10-11 16:00:02 · 783 阅读 · 0 评论 -
数据结构 P38 算法实现 在带头结点的单链表的第i个元素插入元素e
/*算法2.20*/ #include using namespace std; struct node //创建节点 { int date; node *next; }; class list //创建链表 { int Length;原创 2017-10-11 21:22:03 · 11514 阅读 · 0 评论 -
数据结构 P42-43 算法实现 多项式的建立及加法
/*多项式的建立及加法*/ #include using namespace std; struct node { int coefficient; //系数 int exponent; //指数 node *next; }; class polynomial //多项式 {原创 2017-10-14 09:17:50 · 762 阅读 · 0 评论 -
数据结构 P43 算法实现 两个一元多项式相乘
/*程序*/ #include using namespace std; struct node { int coefficient; //系数 int exponent; //指数 node *next; }; class polynomial //多项式 { publi原创 2017-10-14 15:48:53 · 3483 阅读 · 0 评论 -
数据结构 P64-65 算法实现 循环队列的创建和基本操作
#include using namespace std; typedef int QElemType; #define MAXQSIZE 100 struct linkqueue //创建循环队列结构体 { QElemType *base; //初始化的动态分配存储空间 int front; //原创 2017-10-24 21:05:19 · 556 阅读 · 0 评论