Skip to content

Commit 954b55d

Browse files
committed
add SwissDict to docs
1 parent e2bc9a4 commit 954b55d

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This package implements a variety of data structures, including
2323
- Mutable Binary Heap
2424
- Ordered Dicts and Sets
2525
- RobinDict (implemented with [Robin Hood Hashing](https://cs.uwaterloo.ca/research/tr/1986/CS-86-14.pdf))
26+
- SwissDict (inspired from [SwissTables](https://abseil.io/blog/20180927-swisstables))
2627
- Dictionaries with Defaults
2728
- Trie
2829
- Linked List and Mutable Linked List

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ makedocs(
1919
"ordered_containers.md",
2020
"default_dict.md",
2121
"robin_dict.md",
22+
"swiss_dict.md",
2223
"trie.md",
2324
"linked_list.md",
2425
"mutable_linked_list.md",

docs/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This package implements a variety of data structures, including
1515
- Mutable Binary Heap
1616
- Ordered Dicts and Sets
1717
- RobinDict and OrderedRobinDict (implemented with [Robin Hood Hashing](https://cs.uwaterloo.ca/research/tr/1986/CS-86-14.pdf))
18+
- SwissDict (inspired from [SwissTables](https://abseil.io/blog/20180927-swisstables))
1819
- Dictionaries with Defaults
1920
- Trie
2021
- Linked List and Mutable Linked List

docs/src/swiss_dict.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
```@meta
2+
DocTestSetup = :(using DataStructures)
3+
```
4+
5+
# SwissDict
6+
7+
`SwissDict` provides a standard dictionary, conforming to the AbstractDict protocol, which is inspired from SwissTable developed by Google. This provides improved performance over Dict at extremely high Load Factor.
8+
9+
The interface of `SwissDict` replicates that of `Dict`.
10+
11+
Examples:
12+
13+
```jldoctest
14+
julia> d = RobinDict{Int, Char}(1 => 'a', 2 => 'b')
15+
SwissDict{Int64,Char} with 2 entries:
16+
1 => 'a'
17+
2 => 'b'
18+
19+
julia> d[3] = 'c';
20+
21+
julia> collect(d)
22+
3-element Array{Pair{Int64,Char},1}:
23+
1 => 'a'
24+
2 => 'b'
25+
3 => 'c'
26+
27+
julia> delete!(d, 2);
28+
29+
julia> d[1]
30+
'a': ASCII/Unicode U+0061 (category Ll: Letter, lowercase)
31+
32+
julia> d
33+
SwissDict{Int64,Char} with 2 entries:
34+
1 => 'a'
35+
3 => 'c'
36+
37+
julia> pop!(d)
38+
1 => 'a'
39+
```
40+
41+
```@meta
42+
DocTestSetup = nothing
43+
```

0 commit comments

Comments
 (0)