This commit is contained in:
krahets
2024-03-31 03:53:04 +08:00
parent 87af663929
commit c23e576da4
68 changed files with 2139 additions and 22 deletions

View File

@ -594,6 +594,18 @@ The design of hash algorithms is a complex issue that requires consideration of
}
```
=== "Ruby"
```ruby title="simple_hash.rb"
[class]{}-[func]{add_hash}
[class]{}-[func]{mul_hash}
[class]{}-[func]{xor_hash}
[class]{}-[func]{rot_hash}
```
=== "Zig"
```zig title="simple_hash.zig"

View File

@ -1426,6 +1426,12 @@ The code below provides a simple implementation of a separate chaining hash tabl
}
```
=== "Ruby"
```ruby title="hash_map_chaining.rb"
[class]{HashMapChaining}-[func]{}
```
=== "Zig"
```zig title="hash_map_chaining.zig"
@ -3072,6 +3078,12 @@ The code below implements an open addressing (linear probing) hash table with la
}
```
=== "Ruby"
```ruby title="hash_map_open_addressing.rb"
[class]{HashMapOpenAddressing}-[func]{}
```
=== "Zig"
```zig title="hash_map_open_addressing.zig"

View File

@ -1697,6 +1697,14 @@ The following code implements a simple hash table. Here, we encapsulate `key` an
}
```
=== "Ruby"
```ruby title="array_hash_map.rb"
[class]{Pair}-[func]{}
[class]{ArrayHashMap}-[func]{}
```
=== "Zig"
```zig title="array_hash_map.zig"