Skip to content

Commit 65d13fc

Browse files
committed
Fixed typos
1 parent 13fc337 commit 65d13fc

File tree

1 file changed

+5
-5
lines changed
  • 07-week-6--foundational-data-structures/02-day-4--underneath-hashes

1 file changed

+5
-5
lines changed

07-week-6--foundational-data-structures/02-day-4--underneath-hashes/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ does it work under the hood?
1919
## Hash Functions
2020

2121
For a hash to work, we use a **hash function** to determine where in memory to
22-
store a information related to that key. Later, we use the same hash function to
22+
store information related to that key. Later, we use the same hash function to
2323
determine where to search for a given key.
2424

2525
One way to think about how hashes relate to hash functions is thinking about how
@@ -29,7 +29,7 @@ author of a book, and the librarian tells us precisely where to find the book.
2929
![library book example](https://s3-us-west-2.amazonaws.com/curriculum-content/algorithms/dewey-decimal-arrangement.jpg)
3030

3131
In this analogy, our **key** is the title and author of the book, which we can
32-
use to determine the appropriate card catalogue id. The card catalogue id (which
32+
use to determine the appropriate card catalog id. The card catalog id (which
3333
comes from the Dewey Decimal System above — think of that as our **hash
3434
function**) tells us exactly where to find the book. If the book is there, we
3535
have our book and all of the information inside. If nothing is there, there is
@@ -121,7 +121,7 @@ technique, our hash table looks like the following:
121121
| 800 | [ "*War and Peace*" ] |
122122
| 900 | [ "*Alexander Hamilton*" ] |
123123

124-
In the worse case scenario, all of our inserted elements collide, and we have to
124+
In the worst case scenario, all of our inserted elements collide, and we have to
125125
traverse a linked list of length `n` to retrieve an element, so we have **O(n)**
126126
runtime. However, on average collisions do not occur, so we achieve constant
127127
time for lookup, insertion and deletion _on average_.
@@ -137,9 +137,9 @@ the chance of a collision occurring. Some properties of a good hash function are
137137
values.
138138
2. Maps similar keys to very different values - making collisions much less likely.
139139

140-
### Summary
140+
## Conclusion
141141

142-
In this lesson we learned about **hash tables**. Hash tables use a **hash
142+
In this lesson, we learned about **hash tables**. Hash tables use a **hash
143143
function** to output a **hash value**. The hash value determines where to place
144144
the element in memory. Because a hash function produces the same hash value for
145145
a given element, it also gives us fast lookup time to retrieve an element.

0 commit comments

Comments
 (0)