上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 31 下一页
摘要: #include<iostream> using namespace std; template<typename T> //函数模板 T maxr(T a,T b){ return a>b?a:b; } template<typename T> //类模板 class test{ private: 阅读全文
posted @ 2021-02-16 21:27 nanfengnan 阅读(22) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/alantu2018/p/8459250.html 大神的文章 阅读全文
posted @ 2021-02-16 11:55 nanfengnan 阅读(20) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <bitset>//bitset<t> t是二进制的01代码的长度 using namespace std; int main(){ int y; for(int i=0;i<=32;i++){ cout<<(bitset<5>)i<<end 阅读全文
posted @ 2021-02-15 09:56 nanfengnan 阅读(293) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<stdlib.h> using namespace std; typedef int DataType; typedef struct node{ //队列的链式结点 DataType data; struct node *next; }Lin 阅读全文
posted @ 2021-02-15 08:13 nanfengnan 阅读(60) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<vector> using namespace std; typedef int DataType; #define MaxSize 50 typedef struct { //循环队列的存储结构 DataType data[MaxSize]; 阅读全文
posted @ 2021-02-14 21:11 nanfengnan 阅读(29) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #define MaxSize 50 using namespace std; typedef int DataType; //队列的顺序存储结构 typedef struct{ DataType data[MaxSize]; //存放队列中的数据元素 int 阅读全文
posted @ 2021-02-14 16:42 nanfengnan 阅读(40) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #define MaxSize 50 typedef int DataType; using namespace std; //栈的数据结构 //顺序栈 /* 数据运算: 1.初始化一个空栈:初始指针 1 2.数据元素入栈:如果栈没满,数据元素入栈 3.数据元素 阅读全文
posted @ 2021-02-14 15:53 nanfengnan 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 1.我们默认一般使用带头结点的单链表 head-next=NULL;初始状态 2.头结点的数据域不赋值 头节点只有指针域有值 3.带头结点的好处,就是在插入和删除,求表长等时不需要判断是不是空表,因为带头结点head了,就一定不是空表4.单链表和循环链表的区别 单链表的结尾指向NULL,循环链表的结 阅读全文
posted @ 2021-02-05 16:50 nanfengnan 阅读(160) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include <stdlib.h> using namespace std; typedef int DataType; //使int重命名为DataType DataType flag = 0; //flag是用来判断神魔时候输入数据结束 typedef 阅读全文
posted @ 2021-02-05 16:44 nanfengnan 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 单链表的创建方法:头插法和尾插法 单链表创建建议带头节点,因为能减少麻烦 按照是否带头节点又分为:带头结点的头插法,尾插法和不带头结点的头插法,尾插法 1.单链表的结构定义 typedef int DataType; //给int数据类型起一个别名,叫DataType typedef struct 阅读全文
posted @ 2021-02-05 10:01 nanfengnan 阅读(96) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 31 下一页