Update for 03-05-22 20:45
This commit is contained in:
parent
10fd98e155
commit
3705b2634e
@ -90,5 +90,6 @@ Different ways to store and operate on data, with differing efficiency
|
|||||||
== Misc ==
|
== Misc ==
|
||||||
|
|
||||||
* [[p_vs_np]]
|
* [[p_vs_np]]
|
||||||
|
* [[quadratic_probing]]
|
||||||
|
|
||||||
[[index]]
|
[[index]]
|
||||||
|
@ -11,6 +11,7 @@ flavors.
|
|||||||
== Bad for ==
|
== Bad for ==
|
||||||
|
|
||||||
* Non basic data types (unless you create a really good hash function)
|
* Non basic data types (unless you create a really good hash function)
|
||||||
|
* also see [[quadratic_probing]]
|
||||||
|
|
||||||
== Optimize ==
|
== Optimize ==
|
||||||
|
|
||||||
|
16
tech/quadratic_probing.wiki
Normal file
16
tech/quadratic_probing.wiki
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
= Quadratic Probing =
|
||||||
|
|
||||||
|
Quadratic probing is a scheme for resolving hash collisions in [[hash_table]]s.
|
||||||
|
It operates by taking the original hash index and adding sucessive values of an
|
||||||
|
arbitrary quadratic polymoial until an open solt is found.
|
||||||
|
|
||||||
|
== Example ==
|
||||||
|
|
||||||
|
For some `h(k)` that is a hash function, mapping to the keyspace [0, m-1],
|
||||||
|
where m is the size of a hash table, let the _i_th probe position for some _k_
|
||||||
|
be,
|
||||||
|
{{{
|
||||||
|
h(k,i) = h(k) + c1i + c2i^2 mod m
|
||||||
|
}}}
|
||||||
|
|
||||||
|
Where c2 != 0 and c1 and c2 are constants.
|
Loading…
Reference in New Issue
Block a user