docs: update containers API docs

This commit is contained in:
2026-03-20 02:35:01 +08:00
parent a647f5e8ec
commit 0c073db4e8
33 changed files with 135 additions and 56 deletions

View File

@@ -4,11 +4,22 @@
**类型**: `class` (template)
**头文件**: `XCEngine/Containers/HashMap.h`
**描述**: 模板哈希表容器,提供键值对存储和快速查找。
## 概述
`HashMap<Key, Value>` 是一个模板哈希表容器,使用动态数组作为桶来解决哈希冲突,支持键值对的插入、查找和删除操作
`HashMap<Key, Value>` 是一个模板哈希表容器,使用分离链接法separate chaining解决哈希冲突每个桶是一个动态数组
## 实现细节
| 参数 | 值 | 描述 |
|------|-----|------|
| 默认桶数 | 16 | `DefaultBucketCount` |
| 负载因子 | 0.75 | 当 `size / bucketCount > 0.75` 时触发扩容 |
| 扩容策略 | ×2 | 每次扩容桶数翻倍 |
| Erase 策略 | swap-with-last | 将待删除元素与最后一个元素交换,避免数组元素移动 |
## 公共类型