上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 63 下一页
摘要: /** * Note: The returned array must be malloced, assume caller calls free(). */ int* findDisappearedNumbers(int* nums, int numsSize, int* returnSize){ 阅读全文
posted @ 2020-10-17 01:07 温暖了寂寞 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 1.关于list容器 list是一种序列式容器。list容器完成的功能实际上和数据结构中的双向链表是极其相似的,list中的数据元素是通过链表指针串连成逻辑意义上的线性表,也就是list也具有链表的主要优点,即:在链表的任一位置进行元素的插入、删除操作都是快速的。list的实现大概是这样的:list 阅读全文
posted @ 2020-10-11 15:47 温暖了寂寞 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 一、概述 deque(双端队列)是由一段一段的定量连续空间构成,可以向两端发展,因此不论在尾部或头部安插元素都十分迅速。 在中间部分安插元素则比较费时,因为必须移动其它元素。 回到顶部 二、定义及初始化 使用之前必须加相应容器的头文件: #include <deque> // deque属于std命 阅读全文
posted @ 2020-10-10 18:45 温暖了寂寞 阅读(2351) 评论(0) 推荐(0) 编辑
摘要: char * countAndSay(int n){ int i,j,cnt,len; char buffer[100]={0}; char* pre = (char*)calloc(10000,sizeof(char)); sprintf(pre,"%d",1); for (i=2; i<=n; 阅读全文
posted @ 2020-10-08 16:40 温暖了寂寞 阅读(99) 评论(0) 推荐(0) 编辑
摘要: https://www.runoob.com/cplusplus/cpp-exceptions-handling.html 阅读全文
posted @ 2020-10-05 11:42 温暖了寂寞 阅读(92) 评论(0) 推荐(0) 编辑
摘要: C++类型转换主要分为两种:隐式类型转换、显式类型转换(强制类型转换)。 【1】隐式类型转换 所谓隐式类型转换,是指不需要用户干预,编译器默认进行的类型转换行为(很多时候用户可能都不知道到底进行了哪些转换)。 隐式类型转换一般分为两种:内置数据类型、自定义数据类型。 [1.1] 内置数据类型(基本数 阅读全文
posted @ 2020-10-04 13:43 温暖了寂寞 阅读(220) 评论(0) 推荐(0) 编辑
摘要: int cmp(const void*a, const void*b){ return *(int*)b > *(int*)a; } int findLucky(int* arr, int arrSize){ qsort(arr,arrSize,sizeof(int),cmp); int i,cnt 阅读全文
posted @ 2020-10-04 00:45 温暖了寂寞 阅读(151) 评论(0) 推荐(0) 编辑
摘要: C++的 bitset 在 bitset 头文件中,它是一种类似数组的结构,它的每一个元素只能是0或1,每个元素仅用1bit空间。 下面是具体用法 构造函数 bitset常用构造函数有四种,如下 bitset<4> bitset1; //无参构造,长度为4,默认每一位为0 bitset<8> bit 阅读全文
posted @ 2020-10-02 11:01 温暖了寂寞 阅读(400) 评论(0) 推荐(0) 编辑
摘要: https://www.runoob.com/w3cnote/cpp-vector-container-analysis.html 阅读全文
posted @ 2020-10-02 10:58 温暖了寂寞 阅读(103) 评论(0) 推荐(0) 编辑
摘要: https://www.runoob.com/w3cnote/cpp-enum-intro.html 阅读全文
posted @ 2020-09-30 14:41 温暖了寂寞 阅读(257) 评论(0) 推荐(0) 编辑
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 63 下一页