docs: update containers API docs
This commit is contained in:
@@ -11,7 +11,13 @@ bool Erase(const Key& key);
|
||||
|
||||
**返回:** 如果元素被删除返回 `true`,如果键不存在返回 `false`。
|
||||
|
||||
**复杂度:** O(1) 平均,最坏 O(n)
|
||||
**复杂度:** O(1) 平均,最坏 O(n)(同一桶中有多个键发生哈希冲突)
|
||||
|
||||
**线程安全:** ❌ 非线程安全
|
||||
|
||||
**异常:** 无
|
||||
|
||||
**实现备注:** 使用 swap-with-last 策略,将待删除元素与桶内最后一个元素交换,然后 popBack,避免数组元素批量移动。
|
||||
|
||||
**示例:**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user