We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c3fb5a commit 89a9581Copy full SHA for 89a9581
problems/380.insert-delete-getrandom-o1.md
@@ -76,6 +76,20 @@ randomSet.getRandom();
76
77
> 相应地,我们插入的时候,需要维护哈希表
78
79
+图解:
80
+
81
+以依次【1,2,3,4】之后为初始状态,那么此时状态是这样的:
82
83
+
84
85
+而当要插入一个新的5的时候, 我们只需要分别向数组末尾和哈希表中插入这条记录即可。
86
87
+
88
89
+而删除的时候稍微有一点复杂:
90
91
+
92
93
## 关键点解析
94
95
- 数组
0 commit comments