Skip to content

Commit 6feecb5

Browse files
Update Hash-table.md
1 parent c32d11e commit 6feecb5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dsa/intermediate/Hash-table.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ Map the hash code to an index.
3232
Locate the key in the bucket and remove the key-value pair. Adjust the structure to maintain efficiency (e.g., rehash elements if necessary).
3333

3434
## Complexity
35-
Average Time Complexity: O(1) for insert, delete, and search operations in a well-implemented hash table with a good hash function and a load factor that avoids excessive collisions.
35+
Average Time Complexity: $O(1)$ for insert, delete, and search operations in a well-implemented hash table with a good hash function and a load factor that avoids excessive collisions.
3636

37-
Worst-Case Time Complexity: O(n) for insert, delete, and search operations if all keys hash to the same index (highly unlikely with a good hash function).
37+
Worst-Case Time Complexity: $O(n)$ for insert, delete, and search operations if all keys hash to the same index (highly unlikely with a good hash function).
3838

3939
## Load Factor
40-
The load factor (α) is the ratio of the number of entries to the number of buckets in the hash table. A high load factor can lead to more collisions, affecting performance. A common practice is to resize the hash table (rehash) when the load factor exceeds a certain threshold.
40+
The load factor $(α)$ is the ratio of the number of entries to the number of buckets in the hash table. A high load factor can lead to more collisions, affecting performance. A common practice is to resize the hash table (rehash) when the load factor exceeds a certain threshold.
4141

4242

43-
​Load Factor = No. of entries / No. of Buckets
43+
$$​Load Factor = No. of entries / No. of Buckets$$
4444

4545

4646
**Rehashing**

0 commit comments

Comments
 (0)