mirror of
https://github.com/krahets/hello-algo.git
synced 2026-07-18 01:36:07 +00:00
feat: add Swift codes for hash_collision article (#569)
* feat: add Swift codes for hash_collision article * refactor: extract common Pair * Update hash_map.md --------- Co-authored-by: Yudong Jin <krahets@163.com>
This commit is contained in:
@@ -4,16 +4,7 @@
|
||||
* Author: nuomi1 (nuomi1@qq.com)
|
||||
*/
|
||||
|
||||
/* 键值对 */
|
||||
class Pair {
|
||||
var key: Int
|
||||
var val: String
|
||||
|
||||
init(key: Int, val: String) {
|
||||
self.key = key
|
||||
self.val = val
|
||||
}
|
||||
}
|
||||
import utils
|
||||
|
||||
/* 基于数组简易实现的哈希表 */
|
||||
class ArrayHashMap {
|
||||
|
||||
Reference in New Issue
Block a user