news 2026/3/2 5:41:03

【C++】优选算法必修篇之双指针实战:移动零 复写零

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
【C++】优选算法必修篇之双指针实战:移动零 复写零

应用场景

在算法中,双指针(Two Pointers)是一种极具代表性的高效技巧。它通过维护两个索引或指针,在一次遍历中完成双层循环才能解决的问题,从而显著降低时间复杂度。常见的双指针形态主要分为两类:对撞指针快慢指针。这两种形式几乎覆盖了所有数组、字符串与链表中的高频算法场景,是算法思维中必须掌握的核心技巧。

  1. 对撞指针(Collision Pointers):
  • 对撞指针一般用于有序数组或字符串等结构中,其特征是两个指针分别从两端开始,向中间移动。通过左右相向的方式逐步缩小搜索范围,从而在一次扫描中解决问题。
  • 这种方法常用于判断字符串是否为回文、有序数组的两数之和、区间反转、移动零或划分问题等。它的本质思想是——利用数据的有序性或对称性,通过条件判断决定哪一侧的指针移动,最终达到在 O(n) 时间内完成目标的效果。
  • 对撞指针的优点是逻辑直观、空间占用低,通常仅需常数级的额外空间即可完成操作。
  1. 快慢指针(Fast-Slow Pointers):
  • 快慢指针常用于链表或数组的遍历、修改与结构判断中。两者方向一致,但移动速度不同:快指针一般一次移动两步或多步,而慢指针一次移动一步。通过速度差,快指针可以“探测”结构特征或帮助慢指针完成就地操作。
  • 这种方法常见于链表判环、寻找中点、删除重复元素、原地压缩数组、复写 0 等问题。
  • 其核心思想是让快指针负责探索与筛选,慢指针负责记录与写入。这样能在单次遍历中实现去重、压缩、复制等效果,无需额外数组或中间存储,既高效又节省空间。
1. 移动零
1.1 题目链接

链接直达请点击<----------

1.2 题目描述

在这里插入图片描述

1.3 题目示例

在这里插入图片描述

1.4 题目思路

  1. 我们可以用一个快排思想:用一个right指针(快指针)用来遍历整个数组,另外一个left指针(慢指针)用来记录下一个非零元素应该存放的位置。
  2. right指针扫描到非零元素时,就先将left++,因为开始指向的位置在-1处,然后将其移动到left指针所指的位置。这样可以确保所有非零元素按照原有顺序被前移。right指针继续向后遍历,直到扫描完整个数组。
  3. right指针遍历结束后,left指针之前的部分已经全部是非零元素,left指针及其之后的位置则应当全部填充为 0。
  4. 在这期间,0 ~ left期间元素都将是非0;left+1 ~ right-1期间的元素都是0
1.5 核心代码实现

代码语言:javascript

AI代码解释

class Solution { public: void moveZeroes(vector<int>& nums) { int left = -1; int right = 0; for (right = 0; right < nums.size(); right++) { if (nums[right] != 0) swap(nums[right], nums[++left]); } } };
1.6 示例测试(总代码)

代码语言:javascript

AI代码解释

//零移动和复写零 #include<iostream> #include<vector> using namespace std; class Solution { public: void moveZeroes(vector<int>& nums) { int left = -1; int right = 0; for (right = 0; right < nums.size(); right++) { if (nums[right] != 0) swap(nums[right], nums[++left]); } } }; int main() { vector<int> nums = { 0,1,0,3,2 }; Solution().moveZeroes(nums); for (auto e : nums) { cout << e << " "; } cout << endl; return 0; }

在这里插入图片描述

2. 复写零
2.1 题目链接

链接直达请点击<----------

2.2 题目描述

在这里插入图片描述

2.3 题目示例

在这里插入图片描述

2.4 题目思路
  1. 当我们从前往后复写的时候,每当我们遇到一个 0 时,需要在它后面再插入一个 0,然后原数组后续元素整体右移。但由于数组长度是固定的,超出边界的部分要被自动舍弃。所以核心难点在于如何在不破坏未处理数据的情况下完成移动。

代码语言:javascript

AI代码解释

当我们正着复写下面这个数组的时候: arr = [1, 0, 0, 2, 3]

我们在处理第一个0时,就提前右移覆盖掉了第二个0; 第二个0还没来得及被复写,它就被前一步操作的结果顶掉了;最终结果变成了错误的:

代码语言:javascript

AI代码解释

[1, 0, 0, 0, 2]

实际正确结果应是:

代码语言:javascript

AI代码解释

[1, 0, 0, 0, 0]
  1. 我们可以借助快慢指针(Fast-Slow Pointers)的思想来实现。
  • 首先,通过一次遍历,计算“如果每个 0 都被复写一次,整个数组理论上需要多长”。这个虚拟长度(用快指针fast表示)会超过数组的实际长度,而慢指针slow则用来记录当前正在处理的元素位置。遍历过程中,fast会根据元素是否为 0 来累加长度:若元素不是 0,长度加 1;若是 0,则长度加 2。这样,当fast的值刚好达到或超过数组长度时,就说明慢指针的位置到达了数组中最后一个需要处理的元素。
  • 接下来进入第二阶段,也就是倒序写入阶段。此时我们从slowfast两个指针的末端开始,从右向左遍历。这样做的好处是可以避免在复写 0 时覆盖掉尚未处理的元素。如果当前元素(slow指向的元素)是非零,则直接将其写入当前位置(fast指向的位置);若是 0,则需要写入两次(一个当前位置、一个前一位置),并且注意边界防止越界写入。通过这种倒序的处理方式,我们能在不额外开辟空间的情况下完成所有复写操作。

如图:我们通过这段示例可以知道找到在复写中最后一个需要处理的元素是4

在这里插入图片描述

代码语言:javascript

AI代码解释

int slow = 0; int fast = -1; int n = arr.size(); //找最后一个数 while (slow < n) { if (arr[slow]) fast++; else fast += 2; if (fast >= n - 1) break; else slow++; }

接下来我们进行第二步,从右向左遍历进行复写

在这里插入图片描述

  • 当出现fast == n时,说明最后一次复写操作正好溢出了数组长度。例如数组[1,0,2,3,0,4],长度为 5,最后一个元素是 0。复写这个 0 需要写入两个 0(一个是原来的,一个是复写的),但第二个 0 会落在下标 5 上,也就是数组边界之外。这时我们只能在数组的最后一个合法位置(下标 n−1)写入一个 0,然后将其余逻辑稍作调整。

代码语言:javascript

AI代码解释

//处理边界情况 if (fast == n) { arr[n - 1] = 0; slow--; fast -= 2; }
  • 于是代码执行arr[n - 1] = 0;,在最后一个位置写入一个 0;接着slow--将原数组指针向前移动一位,表示刚才的 0 已经部分处理完成,不再继续参与复写;最后fast -= 2是为了让复写指针同步回退两位,确保后续从后往前的填充操作可以正确对应。

代码语言:javascript

AI代码解释

//从后向前完成复写操作 while (slow >= 0) { if (arr[slow]) arr[fast--] = arr[slow--]; else { arr[fast--] = 0; arr[fast--] = 0; slow--; } }
2.5 核心代码实现

代码语言:javascript

AI代码解释

class Solution2{ public: void duplicateZeros(vector<int>& arr) { int slow = 0; int fast = -1; int n = arr.size(); //找最后一个数 while (slow < n) { if (arr[slow]) fast++; else fast += 2; if (fast >= n - 1) break; else slow++; } //处理边界情况 if (fast == n) { arr[n - 1] = 0; slow--; fast -= 2; } //从后向前完成复写操作 while (slow >= 0) { if (arr[slow]) arr[fast--] = arr[slow--]; else { arr[fast--] = 0; arr[fast--] = 0; slow--; } } } };
2.6 示例测试(总代码)

代码语言:javascript

AI代码解释

//零移动和复写零 #include<iostream> #include<vector> using namespace std; class Solution2{ public: void duplicateZeros(vector<int>& arr) { int slow = 0; int fast = -1; int n = arr.size(); //找最后一个数 while (slow < n) { if (arr[slow]) fast++; else fast += 2; if (fast >= n - 1) break; else slow++; } //处理边界情况 if (fast == n) { arr[n - 1] = 0; slow--; fast -= 2; } //从后向前完成复写操作 while (slow >= 0) { if (arr[slow]) arr[fast--] = arr[slow--]; else { arr[fast--] = 0; arr[fast--] = 0; slow--; } } } }; int main() { vector<int> nums1 = { 0,1,0,3,2 }; Solution2().duplicateZeros(nums1); for (auto e1 : nums1) { cout << e1 << " "; } cout << endl; return 0; }

总结

在本篇文章中,我们通过「移动零」与「复写零」两个经典题目,深入理解了双指针(Two Pointers)的核心思想与应用方式。

m.pbzjb.pro/post/11757.html
m.pbzjb.pro/post/79719.html
m.pbzjb.pro/post/24682.html
m.pbzjb.pro/post/68046.html
m.pbzjb.pro/post/44202.html
m.pbzjb.pro/post/33995.html
m.pbzjb.pro/post/84266.html
m.pbzjb.pro/post/35555.html
m.pbzjb.pro/post/46260.html
m.pbzjb.pro/post/57197.html
m.pbzjb.pro/post/35133.html
m.pbzjb.pro/post/62442.html
m.pbzjb.pro/post/57593.html
m.pbzjb.pro/post/51913.html
m.pbzjb.pro/post/75575.html
m.pbzjb.pro/post/75777.html
m.pbzjb.pro/post/93391.html
m.pbzjb.pro/post/35575.html
m.pbzjb.pro/post/57393.html
m.pbzjb.pro/post/91717.html
m.pbzjb.pro/post/37917.html
m.pbzjb.pro/post/39713.html
m.pbzjb.pro/post/19999.html
m.pbzjb.pro/post/13943.html
m.pbzjb.pro/post/17797.html
m.pbzjb.pro/post/57117.html
m.pbzjb.pro/post/53777.html
m.pbzjb.pro/post/19555.html
m.pbzjb.pro/post/97931.html
m.pbzjb.pro/post/17917.html
m.pbzjb.pro/post/59995.html
m.pbzjb.pro/post/26004.html
m.pbzjb.pro/post/33979.html
m.pbzjb.pro/post/79795.html
m.pbzjb.pro/post/19337.html
m.pbzjb.pro/post/77371.html
m.pbzjb.pro/post/13599.html
m.pbzjb.pro/post/99553.html
m.pbzjb.pro/post/99511.html
m.pbzjb.pro/post/80848.html
m.pbzjb.pro/post/19733.html
m.pbzjb.pro/post/19711.html
m.pbzjb.pro/post/33771.html
m.pbzjb.pro/post/44668.html
m.pbzjb.pro/post/15399.html
m.pbzjb.pro/post/13491.html
m.pbzjb.pro/post/93571.html
m.pbzjb.pro/post/53177.html
m.pbzjb.pro/post/11317.html
m.pbzjb.pro/post/46046.html
m.pbzjb.pro/post/68620.html
m.pbzjb.pro/post/97313.html
m.pbzjb.pro/post/19777.html
m.pbzjb.pro/post/68466.html
m.pbzjb.pro/post/37777.html
m.pbzjb.pro/post/02280.html
m.pbzjb.pro/post/99339.html
m.pbzjb.pro/post/97377.html
m.pbzjb.pro/post/57337.html
m.pbzjb.pro/post/73913.html
m.pbzjb.pro/post/73593.html
m.pbzjb.pro/post/15335.html
m.pbzjb.pro/post/95377.html
m.pbzjb.pro/post/13795.html
m.pbzjb.pro/post/91979.html
m.pbzjb.pro/post/75913.html
m.pbzjb.pro/post/33975.html
m.pbzjb.pro/post/19779.html
m.pbzjb.pro/post/31513.html
m.pbzjb.pro/post/73931.html
m.pbzjb.pro/post/17757.html
m.pbzjb.pro/post/91519.html
m.pbzjb.pro/post/97133.html
m.pbzjb.pro/post/68808.html
m.pbzjb.pro/post/68448.html
m.pbzjb.pro/post/79953.html
m.pbzjb.pro/post/97191.html
m.pbzjb.pro/post/51199.html
m.pbzjb.pro/post/44002.html
m.pbzjb.pro/post/17513.html
m.pbzjb.pro/post/15359.html
m.pbzjb.pro/post/48444.html
m.pbzjb.pro/post/55113.html
m.pbzjb.pro/post/15319.html
m.pbzjb.pro/post/37173.html
m.pbzjb.pro/post/86240.html
m.pbzjb.pro/post/77775.html
m.pbzjb.pro/post/39511.html
m.pbzjb.pro/post/97991.html
m.pbzjb.pro/post/68886.html
m.pbzjb.pro/post/53933.html
m.pbzjb.pro/post/53191.html
m.pbzjb.pro/post/51333.html
m.pbzjb.pro/post/03059.html
m.pbzjb.pro/post/53751.html
m.pbzjb.pro/post/53711.html
m.pbzjb.pro/post/39933.html
m.pbzjb.pro/post/22428.html
m.pbzjb.pro/post/71935.html
m.pbzjb.pro/post/31731.html
m.pbzjb.pro/post/53715.html
m.pbzjb.pro/post/04680.html
m.pbzjb.pro/post/84680.html
m.pbzjb.pro/post/95751.html
m.pbzjb.pro/post/55575.html
m.pbzjb.pro/post/60686.html
m.pbzjb.pro/post/71311.html
m.pbzjb.pro/post/59115.html
m.pbzjb.pro/post/77517.html
m.pbzjb.pro/post/72178.html
m.pbzjb.pro/post/79591.html
m.pbzjb.pro/post/53353.html
m.pbzjb.pro/post/95715.html
m.pbzjb.pro/post/95315.html
m.pbzjb.pro/post/24466.html
m.pbzjb.pro/post/13553.html
m.pbzjb.pro/post/91917.html
m.pbzjb.pro/post/20820.html
m.pbzjb.pro/post/08260.html
m.pbzjb.pro/post/13535.html
m.pbzjb.pro/post/91359.html
m.pbzjb.pro/post/08466.html
m.pbzjb.pro/post/55199.html
m.pbzjb.pro/post/75957.html
m.pbzjb.pro/post/33511.html
m.pbzjb.pro/post/71837.html
m.pbzjb.pro/post/99753.html
m.pbzjb.pro/post/39173.html
m.pbzjb.pro/post/55759.html
m.pbzjb.pro/post/31135.html
m.pbzjb.pro/post/91793.html
m.pbzjb.pro/post/35155.html
m.pbzjb.pro/post/75557.html
m.pbzjb.pro/post/77539.html
m.pbzjb.pro/post/15131.html
m.pbzjb.pro/post/59351.html
m.pbzjb.pro/post/86660.html
m.pbzjb.pro/post/20080.html
m.pbzjb.pro/post/37711.html
m.pbzjb.pro/post/93935.html
m.pbzjb.pro/post/31933.html
m.pbzjb.pro/post/19939.html
m.pbzjb.pro/post/48020.html
m.pbzjb.pro/post/79739.html
m.pbzjb.pro/post/77977.html
m.pbzjb.pro/post/55715.html
m.pbzjb.pro/post/51171.html
m.pbzjb.pro/post/15959.html
m.pbzjb.pro/post/99539.html
m.pbzjb.pro/post/84686.html
m.pbzjb.pro/post/13717.html
m.pbzjb.pro/post/42020.html
m.pbzjb.pro/post/20004.html
m.pbzjb.pro/post/75159.html
m.pbzjb.pro/post/57199.html
m.pbzjb.pro/post/59975.html
m.pbzjb.pro/post/00288.html
m.pbzjb.pro/post/95793.html
m.pbzjb.pro/post/35779.html
m.pbzjb.pro/post/42820.html
m.pbzjb.pro/post/57195.html
m.pbzjb.pro/post/79597.html
m.pbzjb.pro/post/31357.html
m.pbzjb.pro/post/59399.html
m.pbzjb.pro/post/55719.html
m.pbzjb.pro/post/93313.html
m.pbzjb.pro/post/88280.html
m.pbzjb.pro/post/99155.html
m.pbzjb.pro/post/48408.html
m.pbzjb.pro/post/19359.html
m.pbzjb.pro/post/15595.html
m.pbzjb.pro/post/66246.html
m.pbzjb.pro/post/11955.html
m.pbzjb.pro/post/55917.html
m.pbzjb.pro/post/91559.html
m.pbzjb.pro/post/26280.html
m.pbzjb.pro/post/39571.html
m.pbzjb.pro/post/79175.html
m.pbzjb.pro/post/17157.html
m.pbzjb.pro/post/97975.html
m.pbzjb.pro/post/57951.html
m.pbzjb.pro/post/73173.html
m.pbzjb.pro/post/59111.html
m.pbzjb.pro/post/75513.html
m.pbzjb.pro/post/37577.html
m.pbzjb.pro/post/31537.html
m.pbzjb.pro/post/84286.html
m.pbzjb.pro/post/39931.html
m.pbzjb.pro/post/93373.html
m.pbzjb.pro/post/60664.html
m.pbzjb.pro/post/20222.html
m.pbzjb.pro/post/75531.html
m.pbzjb.pro/post/55979.html
m.pbzjb.pro/post/57793.html
m.pbzjb.pro/post/39913.html
m.pbzjb.pro/post/91113.html
m.pbzjb.pro/post/19931.html
m.pbzjb.pro/post/19973.html
m.pbzjb.pro/post/31579.html
m.pbzjb.pro/post/86226.html
m.pbzjb.pro/post/77959.html
m.pbzjb.pro/post/82068.html
m.pbzjb.pro/post/55557.html
m.pbzjb.pro/post/71795.html
m.pbzjb.pro/post/75771.html
m.pbzjb.pro/post/35591.html
m.pbzjb.pro/post/95755.html
m.pbzjb.pro/post/73139.html
m.pbzjb.pro/post/19731.html
m.pbzjb.pro/post/57157.html
m.pbzjb.pro/post/84048.html
m.pbzjb.pro/post/19519.html
m.pbzjb.pro/post/79599.html
m.pbzjb.pro/post/79771.html
m.pbzjb.pro/post/73915.html
m.pbzjb.pro/post/11359.html
m.pbzjb.pro/post/42680.html
m.pbzjb.pro/post/93377.html
m.pbzjb.pro/post/64044.html
m.pbzjb.pro/post/95579.html
m.pbzjb.pro/post/31193.html
m.pbzjb.pro/post/97353.html
m.pbzjb.pro/post/15915.html
m.pbzjb.pro/post/93537.html
m.pbzjb.pro/post/55173.html
m.pbzjb.pro/post/13591.html
m.pbzjb.pro/post/31531.html
m.pbzjb.pro/post/60020.html
m.pbzjb.pro/post/28246.html
m.pbzjb.pro/post/13159.html
m.pbzjb.pro/post/17791.html
m.pbzjb.pro/post/37515.html
m.pbzjb.pro/post/33333.html
m.pbzjb.pro/post/31711.html
m.pbzjb.pro/post/77397.html
m.pbzjb.pro/post/71595.html
m.pbzjb.pro/post/91571.html
m.pbzjb.pro/post/13517.html
m.pbzjb.pro/post/15159.html
m.pbzjb.pro/post/42082.html
m.pbzjb.pro/post/13797.html
m.pbzjb.pro/post/39515.html
m.pbzjb.pro/post/66820.html
m.pbzjb.pro/post/28080.html
m.pbzjb.pro/post/53791.html
m.pbzjb.pro/post/00204.html
m.pbzjb.pro/post/22604.html
m.pbzjb.pro/post/13735.html
m.pbzjb.pro/post/86842.html
m.pbzjb.pro/post/53339.html
m.pbzjb.pro/post/77979.html
m.pbzjb.pro/post/77173.html
m.pbzjb.pro/post/53731.html
m.pbzjb.pro/post/97179.html
m.pbzjb.pro/post/75757.html
m.pbzjb.pro/post/13375.html
m.pbzjb.pro/post/59193.html
m.pbzjb.pro/post/19355.html
m.pbzjb.pro/post/17135.html
m.pbzjb.pro/post/79317.html
m.pbzjb.pro/post/95775.html
m.pbzjb.pro/post/79915.html
m.pbzjb.pro/post/26406.html
m.pbzjb.pro/post/35735.html
m.pbzjb.pro/post/79731.html
m.pbzjb.pro/post/57771.html
m.pbzjb.pro/post/22200.html
m.pbzjb.pro/post/75313.html
m.pbzjb.pro/post/99513.html
m.pbzjb.pro/post/88666.html
m.pbzjb.pro/post/71533.html
m.pbzjb.pro/post/33153.html
m.pbzjb.pro/post/88208.html
m.pbzjb.pro/post/75193.html
m.pbzjb.pro/post/99535.html
m.pbzjb.pro/post/39991.html
m.pbzjb.pro/post/91111.html
m.pbzjb.pro/post/93753.html
m.pbzjb.pro/post/73535.html
m.pbzjb.pro/post/62428.html
m.pbzjb.pro/post/95791.html
m.pbzjb.pro/post/99157.html
m.pbzjb.pro/post/17955.html
m.pbzjb.pro/post/93177.html
m.pbzjb.pro/post/95155.html
m.pbzjb.pro/post/11795.html
m.pbzjb.pro/post/73379.html
m.pbzjb.pro/post/53115.html
m.pbzjb.pro/post/60046.html
m.pbzjb.pro/post/55755.html
m.pbzjb.pro/post/86608.html
m.pbzjb.pro/post/35397.html
m.pbzjb.pro/post/53155.html
m.pbzjb.pro/post/46008.html
m.pbzjb.pro/post/51539.html
m.pbzjb.pro/post/80080.html
m.pbzjb.pro/post/55751.html
m.pbzjb.pro/post/71153.html
m.pbzjb.pro/post/15973.html
m.pbzjb.pro/post/11573.html
m.pbzjb.pro/post/08428.html
m.pbzjb.pro/post/39115.html
m.pbzjb.pro/post/15919.html
m.pbzjb.pro/post/57115.html
m.pbzjb.pro/post/71539.html
m.pbzjb.pro/post/59997.html
m.pbzjb.pro/post/40844.html
m.pbzjb.pro/post/28226.html
m.pbzjb.pro/post/99199.html
m.pbzjb.pro/post/48739.html
m.pbzjb.pro/post/11337.html
m.pbzjb.pro/post/88022.html
m.pbzjb.pro/post/91935.html
m.pbzjb.pro/post/31937.html
m.pbzjb.pro/post/82460.html
m.pbzjb.pro/post/79351.html
m.pbzjb.pro/post/71111.html
m.pbzjb.pro/post/99577.html
m.pbzjb.pro/post/59939.html
m.pbzjb.pro/post/77571.html
m.pbzjb.pro/post/66204.html
m.pbzjb.pro/post/71513.html
m.pbzjb.pro/post/17315.html
m.pbzjb.pro/post/71577.html
m.pbzjb.pro/post/79379.html
m.pbzjb.pro/post/93337.html
m.pbzjb.pro/post/17953.html
m.pbzjb.pro/post/19579.html
m.pbzjb.pro/post/57171.html
m.pbzjb.pro/post/44082.html
m.pbzjb.pro/post/82080.html
m.pbzjb.pro/post/93915.html
m.pbzjb.pro/post/35737.html
m.pbzjb.pro/post/35115.html
m.pbzjb.pro/post/66602.html
m.pbzjb.pro/post/11335.html
m.pbzjb.pro/post/48240.html
m.pbzjb.pro/post/80608.html
m.pbzjb.pro/post/39159.html
m.pbzjb.pro/post/13519.html
m.pbzjb.pro/post/93591.html
m.pbzjb.pro/post/93319.html
m.pbzjb.pro/post/33133.html
m.pbzjb.pro/post/31511.html
m.pbzjb.pro/post/15559.html
m.pbzjb.pro/post/79531.html
m.pbzjb.pro/post/82682.html
m.pbzjb.pro/post/11733.html
m.pbzjb.pro/post/99151.html
m.pbzjb.pro/post/26668.html
m.pbzjb.pro/post/20622.html
m.pbzjb.pro/post/13937.html
m.pbzjb.pro/post/91577.html
m.pbzjb.pro/post/37111.html
m.pbzjb.pro/post/75117.html
m.pbzjb.pro/post/79171.html
m.pbzjb.pro/post/95151.html
m.pbzjb.pro/post/40862.html
m.pbzjb.pro/post/37937.html
m.pbzjb.pro/post/00820.html
m.pbzjb.pro/post/59559.html
m.pbzjb.pro/post/15351.html
m.pbzjb.pro/post/62882.html
m.pbzjb.pro/post/53999.html
m.pbzjb.pro/post/77117.html
m.pbzjb.pro/post/19591.html
m.pbzjb.pro/post/73553.html
m.pbzjb.pro/post/46826.html
m.pbzjb.pro/post/53157.html
m.pbzjb.pro/post/73351.html
m.pbzjb.pro/post/33351.html
m.pbzjb.pro/post/06408.html
m.pbzjb.pro/post/97997.html
m.pbzjb.pro/post/15535.html
m.pbzjb.pro/post/53931.html
m.pbzjb.pro/post/73911.html
m.pbzjb.pro/post/00404.html
m.pbzjb.pro/post/48220.html
m.pbzjb.pro/post/00880.html
m.pbzjb.pro/post/77333.html
m.pbzjb.pro/post/31155.html
m.pbzjb.pro/post/17957.html
m.pbzjb.pro/post/22424.html
m.pbzjb.pro/post/00408.html
m.pbzjb.pro/post/15395.html
m.pbzjb.pro/post/39759.html
m.pbzjb.pro/post/35775.html
m.pbzjb.pro/post/59391.html
m.pbzjb.pro/post/73155.html
m.pbzjb.pro/post/31951.html
m.pbzjb.pro/post/39939.html
m.pbzjb.pro/post/42208.html

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/2/26 11:28:25

【C++】继承深度解析:继承方式和菱形虚拟继承的详解

一、继承方式1. 单继承一个派生类只有一个直接基类的时候称这个继承为单继承 Person ↓ Teacher ↓ Student &#xff08;单链&#xff09;代码语言&#xff1a;javascriptAI代码解释// 基类&#xff1a;人 class Person { public:string name;int age;void ShowPerson(){cout …

作者头像 李华
网站建设 2026/3/1 17:55:52

Excalidraw背景设置:更换画布颜色或图片

Excalidraw背景设置&#xff1a;更换画布颜色或图片 在团队协作日益依赖数字化工具的今天&#xff0c;一个直观、灵活的视觉表达平台往往能显著提升沟通效率。Excalidraw 作为一款开源的手绘风格白板工具&#xff0c;凭借其轻量、易用和高度可定制的特性&#xff0c;逐渐成为技…

作者头像 李华
网站建设 2026/2/27 22:48:43

Excalidraw深度测评:为什么它成技术团队首选白板工具?

Excalidraw深度测评&#xff1a;为什么它成技术团队首选白板工具&#xff1f; 在一次跨时区的系统设计评审会上&#xff0c;我看到一位同事用鼠标草草画出一个歪歪扭扭的矩形&#xff0c;旁边还连着一条波浪线箭头——那不是失误&#xff0c;而是刻意为之。五分钟后&#xff0c…

作者头像 李华
网站建设 2026/2/24 4:18:12

笨人小白的温故知新——排序(3)

我来啦&#xff01;今天依旧是1177&#xff1a;奇数单增序列的一题多解。 &#xff08;不厌其烦地附上题目&#xff09; 【题目描述】 给定一个长度为N&#xff08;不大于500&#xff09;的正整数序列&#xff0c;请将其中的所有奇数取出&#xff0c;并按升序输出。 【输入】…

作者头像 李华
网站建设 2026/2/25 19:19:53

基于python的RSA加密算法软件的研究设计(源码+文档)

项目简介RSA加密算法软件的研究设计实现了以下功能&#xff1a;通过设计的软件中的固定模块来进行输入内容的添加&#xff0c;并且在线能够通过快速的、几乎不耗费资源的提供加密的内容实现。对于加密后的内容&#xff0c;从表面上看就是一长串无规则的字符串&#xff0c;没有任…

作者头像 李华
网站建设 2026/2/28 9:19:14

Excalidraw界面原型设计:产品经理快速出稿方案

Excalidraw&#xff1a;让产品经理用“一句话”画出界面原型 想象这样一个场景&#xff1a;在一次产品需求评审会上&#xff0c;开发同事皱着眉头问&#xff1a;“你说的这个流程跳转&#xff0c;能不能画个图&#xff1f;”你手头没有现成的设计稿&#xff0c;Figma打开太重&a…

作者头像 李华