摘要: c指针的传递 作为函数参数传递 真正的传入一个指针到函数中 间接的传入指针到函数中 p1就是指针p,而p2是一个新的指针 以下分别为指针p、p1、p2的地址: 作为变量传递 初始值: 直接改变变量的值 间接改变变量的值 这里改变的是指针p2中存储的地址的值,而不是p2中所存储地址对应内存的值 测试程 阅读全文
posted @ 2021-08-27 17:36 main(void) 阅读(193) 评论(0) 推荐(0) 编辑
摘要: //删除指定value节点 class Solution { public: ListNode* removeElements(ListNode* head, int val) { //单独处理head while(head != NULL && head->val == val){ ListNod 阅读全文
posted @ 2024-04-02 09:28 main(void) 阅读(1) 评论(0) 推荐(0) 编辑
摘要: /* * @lc app=leetcode.cn id=209 lang=cpp * * [209] 长度最小的子数组 * 找最短的子数组 */ // @lc code=start class Solution { public: int minSubArrayLen(int target, vec 阅读全文
posted @ 2024-02-25 22:35 main(void) 阅读(2) 评论(0) 推荐(0) 编辑
摘要: // @before-stub-for-debug-begin #include <vector> #include <string> #include "commoncppproblem27.h" using namespace std; // @before-stub-for-debug-end 阅读全文
posted @ 2024-02-23 19:30 main(void) 阅读(2) 评论(0) 推荐(0) 编辑
摘要: * * @lc app=leetcode.cn id=704 lang=cpp * * [704] 二分查找 */ // @lc code=start class Solution { public: int search(vector<int>& nums, int target) { int l 阅读全文
posted @ 2024-02-22 17:13 main(void) 阅读(4) 评论(0) 推荐(0) 编辑
摘要: ##建表相关操作 CREATE TABLE table_name( column1 datatype, column2 datatype, column3 datatype, ..... columnN datatype, PRIMARY KEY( one or more columns )); 创 阅读全文
posted @ 2022-10-18 11:25 main(void) 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 二分法溢出的情况: public int guessNumber(int n) { int leftP = 1; int rightP = n; int mid = 0; while(leftP < rightP){ //皆是因为mid = (rightP + leftP) /2; mid = le 阅读全文
posted @ 2022-10-01 20:13 main(void) 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 串匹配 串的链式存储与朴素(简单)匹配 /* * @Author: itThree * @Date: 2021-09-17 16:46:14 * @LastEditTime: 2021-09-19 15:59:37 * @Description: * @FilePath: \cpp\datas\my 阅读全文
posted @ 2021-09-29 23:41 main(void) 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 稀疏数组 /* * @Author: itThree * @Date: 2021-09-10 15:48:10 * @LastEditTime: 2021-09-15 15:58:50 * @Description: * @FilePath: \cpp\datas\sparseArr.cpp * 光 阅读全文
posted @ 2021-09-15 21:00 main(void) 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 接口 恰当的原则是优先使用类而不是接口。从类开始,如果使用接口的必要性变得很明确,那么就重构。接口是一个伟大的工具,但它们容易被滥用。 接口中可添加静态方法与默认方法 一个类实现一个接口的同时必须实现该接口的所有方法(可以不用实现默认方法即关键词为为 default的方法) extends 只能用于 阅读全文
posted @ 2020-06-29 21:54 main(void) 阅读(311) 评论(0) 推荐(0) 编辑
.c_ad_block { display: none !important; } #ad_t2{ display: none !important; }