struct ProbeSeq {
pos: usize,
stride: usize,
}
Expand description
Probe sequence based on triangular numbers, which is guaranteed (since our table size is a power of two) to visit every group of elements exactly once.
A triangular probe has us jump by 1 more group every time. So first we jump by 1 group (meaning we just continue our linear scan), then 2 groups (skipping over 1 group), then 3 groups (skipping over 2 groups), and so on.
Proof that the probe will visit every group in the table: https://fgiesen.wordpress.com/2015/02/22/triangular-numbers-mod-2n/
Fields§
§pos: usize
§stride: usize
Implementations§
Auto Trait Implementations§
impl Freeze for ProbeSeq
impl RefUnwindSafe for ProbeSeq
impl Send for ProbeSeq
impl Sync for ProbeSeq
impl Unpin for ProbeSeq
impl UnwindSafe for ProbeSeq
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more