Skip to content

Commit f68d9e8

Browse files
gierlachgjohnhurt
authored andcommitted
docs: fix README typos
Includes-commit: 21eee19 Replicated-from: #3
1 parent 2e16058 commit f68d9e8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.bleep

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2857bd37c4e880bfafadeadbdf93a009496dad60
1+
6f6a59de57389578cd13e173b6f8cf2069ea83e1

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This crate is an implementation of the [trie](https://en.wikipedia.org/wiki/Trie
77

88
## Performance
99

10-
There are several other trie implementations for rust that are more full featured, so it you are looking for a more robust tool, you will probably want to check out [`radix_trie`](https://crates.io/crates/radix_trie) which seems to have the best features and performance. On the other hand, if you want raw speed and have the same narrow use case, you came to the right place!
10+
There are several other trie implementations for rust that are more full-featured, so if you are looking for a more robust tool, you will probably want to check out [`radix_trie`](https://crates.io/crates/radix_trie) which seems to have the best features and performance. On the other hand, if you want raw speed and have the same narrow use case, you came to the right place!
1111

1212
Here is a chart showing the time taken to read 10k entries from a map that consists of 119 entries containing only lower-case characters, numbers, and `-`. As you can see, when miss rate gets above 50% the performance of trie-hard surpasses `std::HashMap` and improves as miss rates get higher.
1313

@@ -69,7 +69,7 @@ let root = Node {
6969

7070
This tells us that if a byte other than `a` or `d` appears in the first position, the key being tested does not appear in the trie. This ability to make an exclusion decision at every step is what makes tries more appealing than even hashmaps in some cases. Searching for a string in a hashmap requires hashing the entire string whereas a trie can potentially determine that a string is not part of a set within a single byte.
7171

72-
If the byte is `a` or `d` we still need to know which node to go to next. All nodes in the graph are stored in contiguous a vector (with the root node at index zero). Each node will contain the information on where its child appears in the array of nodes. In our example the root node will point to nodes with indexes 1 and 2. Where 1 is the index with keys starting with `a` and 2 is the node for keys starting with `d`. It is important that these child nodes are ordered by their corresponding byte.
72+
If the byte is `a` or `d` we still need to know which node to go to next. All nodes in the graph are stored in a contiguous vector (with the root node at index zero). Each node will contain the information on where its child appears in the array of nodes. In our example the root node will point to nodes with indexes 1 and 2. Where 1 is the index with keys starting with `a` and 2 is the node for keys starting with `d`. It is important that these child nodes are ordered by their corresponding byte.
7373

7474
```rust
7575
let root = Node {
@@ -99,7 +99,7 @@ After repeating for one more layer, we can visualize the trie like the this.
9999

100100
Notice that `do` shows up as green because it is a complete word found in the original collection.
101101

102-
Finally we add the last layer and complete this small trie.
102+
Finally, we add the last layer and complete this small trie.
103103

104104

105105
| Conceptual | Trie-Hard |

0 commit comments

Comments
 (0)