You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dsa/intermediate/Hash-table.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -32,15 +32,15 @@ Map the hash code to an index.
32
32
Locate the key in the bucket and remove the key-value pair. Adjust the structure to maintain efficiency (e.g., rehash elements if necessary).
33
33
34
34
## 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.
36
36
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).
38
38
39
39
## 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.
41
41
42
42
43
-
Load Factor = No. of entries / No. of Buckets
43
+
$$Load Factor = No. of entries / No. of Buckets$$
0 commit comments