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
2.**Quadratic Probing**: The cells to search are determined by a quadratic function:
586
585
587
-
$$
588
-
(h(k) + c_1i + c_2i^2) \mod m
589
-
$$
586
+
$$
587
+
(h(k) + c_1i + c_2i^2) \mod m
588
+
$$
590
589
591
-
Positive constants $c1$ and $c2$ are used as increment factors. If the table size is a prime number, these constants can equal 1 and 1, respectively. This scheme can still result in clustering.
590
+
Positive constants $c1$ and $c2$ are used as increment factors. If the table size is a prime number, these constants can equal 1 and 1, respectively. This scheme can still result in clustering.

594
593
595
-
3.**Double Hashing**: Unlike with linear or quadratic probing, the second hash function $h_2(k)$ computes the stride of the probe. The operation is:
594
+
4.**Double Hashing**: Unlike with linear or quadratic probing, the second hash function $h_2(k)$ computes the stride of the probe. The operation is:
596
595
597
-
$$
598
-
(h(k) + ih_2(k)) \mod m
599
-
$$
596
+
$$
597
+
(h(k) + ih_2(k)) \mod m
598
+
$$
600
599
601
-
**Note**: It's crucial for the new probe sequence to cover all positions in the table, thereby ensuring that every slot has the same probability of being the data's final location.
600
+
**Note**: It's crucial for the new probe sequence to cover all positions in the table, thereby ensuring that every slot has the same probability of being the data's final location.
602
601
<br>
603
602
604
603
## 11. Explain the _Time_ and _Space Complexity_ of a _Hash Table_.
0 commit comments