From f86b17a1f09915988a2a6dda54f4b8a9b1d5dca7 Mon Sep 17 00:00:00 2001 From: Flow-sandyu <72751523+Flow-sandyu@users.noreply.github.com> Date: Tue, 4 Oct 2022 21:40:54 +0800 Subject: [PATCH] =?UTF-8?q?update=EF=BC=9A=E5=8F=8C=E6=8C=87=E9=92=88?= =?UTF-8?q?=E6=80=BB=E7=BB=93.md=20=E6=9B=B4=E6=94=B9=E9=94=99=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更改错字 --- problems/双指针总结.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/problems/双指针总结.md b/problems/双指针总结.md index 06752cac..5abcec53 100644 --- a/problems/双指针总结.md +++ b/problems/双指针总结.md @@ -42,7 +42,7 @@ for (int i = 0; i < array.size(); i++) { **其实很多数组(字符串)填充类的问题,都可以先预先给数组扩容带填充后的大小,然后在从后向前进行操作。** -那么在[字符串:花式反转还不够!](https://programmercarl.com/0151.翻转字符串里的单词.html)中,我们使用双指针法,用O(n)的时间复杂度完成字符串删除类的操作,因为题目要产出冗余空格。 +那么在[字符串:花式反转还不够!](https://programmercarl.com/0151.翻转字符串里的单词.html)中,我们使用双指针法,用O(n)的时间复杂度完成字符串删除类的操作,因为题目要删除冗余空格。 **在删除冗余空格的过程中,如果不注意代码效率,很容易写成了O(n^2)的时间复杂度。其实使用双指针法O(n)就可以搞定。**