From a888ab4cc9b809467893876a611faa58945b619c Mon Sep 17 00:00:00 2001 From: "Isaac K. Narteh" Date: Sat, 7 Oct 2023 02:45:57 -0400 Subject: [PATCH] fix #465 --- pretext/SearchHash/Hashing.ptx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pretext/SearchHash/Hashing.ptx b/pretext/SearchHash/Hashing.ptx index 5b54ab45..2396fd25 100644 --- a/pretext/SearchHash/Hashing.ptx +++ b/pretext/SearchHash/Hashing.ptx @@ -20,7 +20,7 @@ value starting at 0.hash table For example, we will have a slot named 0, a slot named 1, a slot named 2, and so on.slotInitially, the hash table contains no items so every slot is empty. We can implement a hash table by using - a list with each value intialized to an empty string. + a list with each value initialized to an empty string. shows a hash table of size m=11. In other words, there are m slots in the table, named 0 through 10.

@@ -28,7 +28,7 @@
Figure 4: Hash Table with 11 Empty Slots
-

The mapping between an item and the slot where that item belongs in the +

In a hash table, the mapping between an item and the slot where that item belongs in the hash table is called the hash function.hash function The hash function will take any item in the collection and return an integer in the range of slot names, between 0 and m-1. Assume that we have the set of integer items @@ -533,7 +533,9 @@ int main() { Implementing the <c>Map</c> Abstract Data Type

One of the most useful C++ data structures is the map. Recall that a map is an associative data type where you can store key–data - pairs. map The key is used to look up the associated data value.

+ pairs. map In a map data structure, the key plays a crucial role as it is used + to look up and retrieve the associated data value. By providing a key, + you can quickly access the specific data element stored within the map.

The map abstract data type is defined as follows. The structure is an unordered collection of associations between a key and a data value. The keys in a map are all unique so that there is a one-to-one relationship