Skip to content

Commit 2633b1a

Browse files
authored
update 1047.删除字符串中的所有相邻重复项: 添加复杂度分析
1 parent 9167188 commit 2633b1a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

problems/1047.删除字符串中的所有相邻重复项.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ public:
7777
}
7878
};
7979
```
80+
* 时间复杂度: O(n)
81+
* 空间复杂度: O(n)
82+
8083

8184
当然可以拿字符串直接作为栈,这样省去了栈还要转为字符串的操作。
8285

@@ -99,6 +102,8 @@ public:
99102
}
100103
};
101104
```
105+
* 时间复杂度: O(n)
106+
* 空间复杂度: O(1),返回值不计空间复杂度
102107
103108
## 题外话
104109

0 commit comments

Comments
 (0)