摘要: 总结与剖析C语言关键字的功能与原理、ANSI C,GNU C、跨平台、多学科角度 阅读全文
posted @ 2024-04-25 20:29 手机快没电了 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 题目:递归实现排列型枚举 把 1∼n这n个整数排成一行后随机打乱顺序,输出所有可能的次序。 输入格式 一个整数n。 输出格式 按照从小到大的顺序输出所有方案,每行 1个。 首先,同一行相邻两个数用一个空格隔开。 其次,对于两个不同的行,对应下标的数一一比较,字典序较小的排在前面。 数据范围 1≤n≤ 阅读全文
posted @ 2024-04-12 20:49 手机快没电了 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 递归实现指数型枚举 从 1∼n 这 n 个整数中随机选取任意多个,输出所有可能的选择方案。 输入格式 输入一个整数 n。 输出格式 每行输出一种方案。 同一行内的数必须升序排列,相邻两个数用恰好1个空格隔开。 对于没有选任何数的方案,输出空行。 各行(不同方案)之间的顺序任意。 数据范围 1≤n≤1 阅读全文
posted @ 2024-04-09 00:13 手机快没电了 阅读(59) 评论(1) 推荐(0) 编辑
摘要: (可以在文章末尾找到MD字样打开源格式阅读进行对照练习) 入门注意: 末尾两个空格等于换行 空格输入方法: 使用全角英文的空格 使用  这样的标记 标题 (注:#号后加空格后面就是标题) 1 一个#号就代表1号标题 2 两个#号就代表2号标题 3 #号越多字越小 4 标题需要在#号后空一格 阅读全文
posted @ 2024-04-08 11:01 手机快没电了 阅读(16) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> class Base { public: int x; }; class Derive : public Base { int y; }; void fun(Base* b) { b[1].x = 1; } int main() { Derive arr[5]; 阅读全文
posted @ 2024-03-19 16:44 手机快没电了 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 一.命名空间 概念:命名空间是新定义的一个作用域,里面可以放函数,变量,定义类等,主要用来防止命名冲突. 实现:namespace关键字 命名空间名字{ 命名空间成员 } 注意点: 1.命名空间可以嵌套使用,还可以使用inline关键字实现版本控制(inline修饰的命名空间默认展开到外一层命名空间 阅读全文
posted @ 2024-03-03 21:56 手机快没电了 阅读(26) 评论(0) 推荐(0) 编辑
摘要: /** 多态/动态调用 * * * 1.虚函数/虚拟函数 * 语法:在函数前面加上virtual * * 1.1虚函数与虚继承没有关系,只是共用了关键字 * * 2.重写/覆盖:虚函数且函数名字类型等完全一样 * $注:虚函数是覆盖,不是虚函数才构成隐藏 * $重写:指对函数体重写,函数体外的是直接 阅读全文
posted @ 2024-02-27 22:56 手机快没电了 阅读(2) 评论(0) 推荐(0) 编辑
摘要: //继承/** * 继承受权限影响 * 有public protected private 三种继承 * * 基本语法: * class student : public Person * { * * 详细:跳转20inheritance -- C++NO.23 -- 3_27 * */ //继承和 阅读全文
posted @ 2024-02-27 22:56 手机快没电了 阅读(4) 评论(0) 推荐(0) 编辑
摘要: #include<time.h> #include<string> #include<vector> #include<iostream> using std::cout; using std::endl; using std::string; namespace test { /**位图概念 * 阅读全文
posted @ 2024-02-27 22:54 手机快没电了 阅读(5) 评论(0) 推荐(0) 编辑
摘要: set #include"26RBT_container.h" namespace test { //set通过普通迭代器使用const迭代器实现限制key不能被修改 template<class K> class set { private: struct setKeyOfT//命名? 返回RBT 阅读全文
posted @ 2024-02-27 22:51 手机快没电了 阅读(1) 评论(0) 推荐(0) 编辑
摘要: #pragma once #include<assert.h> #include<iostream> using std::cout; using std::endl; using std::cin; using std::pair; using std::make_pair; using std: 阅读全文
posted @ 2024-02-27 22:49 手机快没电了 阅读(2) 评论(0) 推荐(0) 编辑
摘要: #pragma once #include<vector> #include<string> #include<iostream> using std::cout; using std::endl; using std::pair; using std::make_pair; namespace H 阅读全文
posted @ 2024-02-27 22:47 手机快没电了 阅读(1) 评论(0) 推荐(0) 编辑
摘要: unordered_set #pragma once #include"28hashtable_container.h" namespace test { //template < // class Key, // unordered_set::key_type/value_type // clas 阅读全文
posted @ 2024-02-27 22:46 手机快没电了 阅读(3) 评论(0) 推荐(0) 编辑
摘要: #pragma once //#include<unordered_map> //#include<unordered_set> #include<string> #include<iostream> using std::cout; using std::endl; using std::cin; 阅读全文
posted @ 2024-02-27 22:41 手机快没电了 阅读(1) 评论(0) 推荐(0) 编辑
摘要: #pragma once //红黑树 Red-Black Tree /** * 简称RBT * * 红黑树是2-3-4树的特殊实现 * * 红黑树的性质/规则 * 1. 每个结点不是红色就是黑色 * 2. 根节点是黑色的 -- (root点要转成黑色) * 3. 如果一个节点是红色的,则它的两个孩子 阅读全文
posted @ 2024-02-27 22:39 手机快没电了 阅读(2) 评论(0) 推荐(0) 编辑
摘要: #pragma once /** note * 简称:AVLT * AVL树,也叫高度平衡搜索二叉树 * * * * 命名:两位俄罗斯的数学家G.M.Adelson-Velskii和E.M.Landis在1962年发明解决二叉搜索树退化成单支树的方法 * -- 所以AVL树以两位俄罗斯数学家的名的开 阅读全文
posted @ 2024-02-27 22:39 手机快没电了 阅读(1) 评论(0) 推荐(0) 编辑
摘要: #pragma once //BST binary search tree /binary sort tree /** * 中文名:二叉搜索树或二叉排序树 * * * * 注:空树也是BST * 性质: * 左子树的所有键值小于根,根小于右子树的所有键值 * * 时间复杂度最坏是O(n),歪脖子树. 阅读全文
posted @ 2024-02-27 22:36 手机快没电了 阅读(2) 评论(0) 推荐(0) 编辑
摘要: #include<deque> //测试用 #include<vector>//测试用 #include"9Date.h"//测试用 #include<iostream> using std::cout; using std::endl; using std::cin; namespace test 阅读全文
posted @ 2024-02-27 22:31 手机快没电了 阅读(1) 评论(0) 推荐(0) 编辑
摘要: #include<list> #include<assert.h> #include<deque> #include<iostream> using std::cout; using std::endl; using std::cin; namespace test { //template<cla 阅读全文
posted @ 2024-02-27 22:27 手机快没电了 阅读(2) 评论(0) 推荐(0) 编辑
摘要: #pragma once #include<assert.h> #include<list> #include<vector> #include<deque> #include<iostream> using std::cout; using std::endl; using std::cin; n 阅读全文
posted @ 2024-02-27 22:26 手机快没电了 阅读(2) 评论(0) 推荐(0) 编辑