上一页 1 2 3 4 5 6 7 8 ··· 33 下一页
摘要: 1.初始化 2.入队 3.出队 4.获取队首元素 5.判断队列是否为空 6.获取队列长度 7.遍历队列 8.销毁队列 9.清空队列(相对于销毁队列清空就是保留头结点,而销毁是彻底摧毁了,再也不能用了,清空,还可以使用) 代码: 1 #include<bits/stdc++.h> 2 using na 阅读全文
posted @ 2019-10-07 14:22 ChunhaoMo 阅读(542) 评论(0) 推荐(0) 编辑
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define sc scanf 4 #define pr printf 5 6 typedef struct LNode 7 { 8 int data; 9 struct LNode *prior 阅读全文
posted @ 2019-10-07 10:02 ChunhaoMo 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define sc scanf 4 #define pr printf 5 6 typedef struct LNode{ 7 int data; 8 struct LNode *next; 9 }LNode,*LinkList; 10 11 void Create_CircleList(Lin 阅读全文
posted @ 2019-10-05 12:29 ChunhaoMo 阅读(324) 评论(0) 推荐(0) 编辑
摘要: 循环链表,相对于普通单向链表,就是最后一个元素的指针域指向头结点 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define sc scanf 4 #define pr printf 5 6 typedef struct LNode{ 7 i 阅读全文
posted @ 2019-09-30 21:36 ChunhaoMo 阅读(183) 评论(1) 推荐(0) 编辑
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define sc scanf 4 #define ElemType int 5 //线性表的链式表示和实现 6 7 typedef struct LNode{ 8 int data; 9 str 阅读全文
posted @ 2019-09-30 19:53 ChunhaoMo 阅读(340) 评论(0) 推荐(0) 编辑
摘要: 1 #include<bits/stdc++.h>//c++万能头文件,写了这个其他头文件不用写 2 using namespace std;//使用名字空间,你不用管 3 4 #define List_Init_Size 100 5 #define List_Inrement 10 6 #define pr printf 7 8 struct List{ 9 int *elem;//表的基地址 阅读全文
posted @ 2019-09-30 12:42 ChunhaoMo 阅读(643) 评论(0) 推荐(0) 编辑
摘要: 1.通过派生类的对象直接访问。前提是public继承 2.通过基类成员函数直接访问基类成员。无论哪种继承方式。基类的public和private都不可以以这种方式访问 3.通过基类名称访问被派生类重定义所隐藏的成员 1 #include<bits/stdc++.h> 2 using namespac 阅读全文
posted @ 2019-09-29 14:04 ChunhaoMo 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 虚析构和纯虚析构的共性 1.可以解决父类指针释放子类对象 2.都需要具体的函数实现 虚析构和纯虚析构的区别 如果是纯虚析构,则该类属于抽象类,无法实例化对象 虚析构语法 virtual ~类名(){} 纯虚析构 virtual ~类名() = 0 纯虚析构的类外实现 类名::~类名(){} 阅读全文
posted @ 2019-09-28 16:53 ChunhaoMo 阅读(328) 评论(0) 推荐(0) 编辑
摘要: 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 class person 5 { 6 public: 7 8 person(int age,int height) 9 { 10 m_age = age; 11 m_Height = new i 阅读全文
posted @ 2019-09-28 13:27 ChunhaoMo 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 首先我们知道只要创建一个类编译器会提供三个默认函数 1.默认构造函数 (无参,空实现) 2.默认析构函数(无参,空实现) 3.默认拷贝构造函数,对值属性进行拷贝 调用规则如下 1.如果我们定义有参构造函数,编译器不会提供默认构造函数,但提供默认拷贝构造函数 2.如果用户定义了拷贝构造函数,编译器将不 阅读全文
posted @ 2019-09-28 11:46 ChunhaoMo 阅读(455) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 33 下一页