上一页 1 2 3 4 5 6 ··· 13 下一页
摘要: ```bash 假设链表中每一个节点的值都在0-9之间,那么链表整体就可以代表一个非负整数。 给定两个这种链表,请生成代表两个整数之差绝对值结果链表。链表长度最大值为10000,链表任意值0≤val3->7,链表2为9->6->3,最后生成新的结果链表为2-~>6, 不允许使用其它数据结构 ``` 阅读全文
posted @ 2023-07-30 12:50 小小灰迪 阅读(193) 评论(0) 推荐(0)
摘要: # 项目属性 ### CMAKE_VERSION ```c++ cmake_minimum_required(VERSION 3.2) if(CMAKE_VERSION VERSION_LESS "3") add_definitions(-std=c++14) else() # add_defini 阅读全文
posted @ 2023-06-19 20:26 小小灰迪 阅读(163) 评论(0) 推荐(0)
摘要: [912. 排序数组](https://leetcode.cn/problems/sort-an-array/) - 稳定排序:如果 a 原本在 b 前面,且 a == b,排序之后 a 仍然在 b 前面。 - 非稳定排序:如果 a 原本在 b 前面,且 a == b,排序之后 a 不一定在 b 前 阅读全文
posted @ 2023-05-30 21:13 小小灰迪 阅读(37) 评论(0) 推荐(0)
摘要: 1. member初始化最好在member initialization list中初始化 因为会constructor可能会扩张代码,会产生临时的object对象,然后将它初始化后,以一个assignment运算符将临时对象指定给类member,然后再销毁临时对象 以下情况会导致效率比较低: 初始 阅读全文
posted @ 2023-05-06 15:43 小小灰迪 阅读(104) 评论(0) 推荐(0)
摘要: 环境配置 sudo apt install libmysqlclient-dev 编译选项 cmake target_link_libraries(main libmysqlclient.so) g++选项 g++ test_mysql.cpp -lmysqlclient -o tets 示例 读取 阅读全文
posted @ 2023-05-04 21:32 小小灰迪 阅读(97) 评论(0) 推荐(1)
摘要: c++11 // #pragma once #include <iostream> #include <thread> #include <memory> #include <vector> #include <queue> #include <functional> // std:;functio 阅读全文
posted @ 2023-04-26 17:38 小小灰迪 阅读(34) 评论(0) 推荐(0)
摘要: cppreference解释地址。 模板参数包在模板参数中的顺序要求: 在主类模板中,模板参数包必须是模板参数列表中的最后一个参数。 在函数模板中,模板参数包可能出现在列表的前面,前提是以下所有参数都可以从函数参数中推导出来,或者具有默认参数: template < typename U, type 阅读全文
posted @ 2023-04-26 17:14 小小灰迪 阅读(619) 评论(0) 推荐(0)
摘要: **Cmake中要将编译版本改成Debug版本** [toc] # linux ## `c_cpp_properties.json`文件 `ctrl+shift+p`弹出搜索框,输入`C++`会显示`C/C++配置UI`,点击后会生成`c_cpp_properties.json`文件 **按需修改` 阅读全文
posted @ 2023-04-21 20:54 小小灰迪 阅读(608) 评论(0) 推荐(0)
摘要: /** linux v2.4.18 * list_entry - get the struct for this entry * @ptr: the &struct list_head pointer. * @type: the type of the struct this is embedded 阅读全文
posted @ 2023-04-21 20:53 小小灰迪 阅读(87) 评论(0) 推荐(0)
摘要: fork流程图 参考 Linux内核进程创建fork源码解析 关于Linux下fork()函数机制? 阅读全文
posted @ 2023-04-17 18:23 小小灰迪 阅读(34) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 13 下一页