chapter
    Hashing and Collision Resolution Short Notes for GATE CS

    Hashing and Collision Resolution short notes for GATE CS: 16 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions

    hashing and collision resolution short notes

    Formula Matrix

    h_i = (h + i) mod m
    Linear: step=1, i≥0
    h_i = (h + i²) mod m
    Quadratic: m prime, α<0.5
    h_i = (h₁ + i·h₂) mod m
    Double: gcd(h₂,m)=1, h₂>0
    Full coverage
    Step and m are coprime
    Prime shortcut
    Any 1≤s<m is coprime
    Secondary cluster
    Same initial hash, same path

    If You See This, Do This

    "linear probing" + "empty slots"
    Trace insertions; update state after every collision.
    "quadratic probing" + "sequence"
    Use i² offsets. Verify m prime, α<0.5.
    "double hashing" + "final slot"
    Compute h₂ once. Add i·h₂ for each probe.
    "guarantee full coverage"
    Check gcd(h₂, m)=1. If m not prime, restrict h₂.
    "h₂ evaluates to 0"
    Infinite loop. Check h₂(k) > 0 for all k.
    "same slot, same path"
    Secondary clustering. Eliminated by double hashing.
    "contiguous block"
    Primary clustering. Present in linear probing.

    Traps and Invariants

    Probe index starts at 1 instead of 0.
    Check: substitute i=0; result must equal h(k).
    h₂(k) evaluates to 0 or shares factor with m.
    Check: verify h₂(k) > 0 and gcd(h₂(k), m) = 1.
    Assume quadratic probing always finds empty slot if table not full.
    Check: verify m is prime and α < 0.5.

    13 more cards in this chapter

    Free preview ends here

    Login to view the complete short notes

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Hashing and Collision Resolution Short Notes for GATE CS

    Hashing and Collision Resolution short notes for GATE CS: 16 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.

    Formula Matrix

    h_i = (h + i) mod m
    Linear: step=1, i≥0
    h_i = (h + i²) mod m
    Quadratic: m prime, α<0.5
    h_i = (h₁ + i·h₂) mod m
    Double: gcd(h₂,m)=1, h₂>0
    Full coverage
    Step and m are coprime
    Prime shortcut
    Any 1≤s<m is coprime
    Secondary cluster
    Same initial hash, same path

    If You See This, Do This

    "linear probing" + "empty slots"
    Trace insertions; update state after every collision.
    "quadratic probing" + "sequence"
    Use i² offsets. Verify m prime, α<0.5.
    "double hashing" + "final slot"
    Compute h₂ once. Add i·h₂ for each probe.
    "guarantee full coverage"
    Check gcd(h₂, m)=1. If m not prime, restrict h₂.
    "h₂ evaluates to 0"
    Infinite loop. Check h₂(k) > 0 for all k.
    "same slot, same path"
    Secondary clustering. Eliminated by double hashing.
    "contiguous block"
    Primary clustering. Present in linear probing.

    Traps and Invariants

    Probe index starts at 1 instead of 0.
    Check: substitute i=0; result must equal h(k).
    h₂(k) evaluates to 0 or shares factor with m.
    Check: verify h₂(k) > 0 and gcd(h₂(k), m) = 1.
    Assume quadratic probing always finds empty slot if table not full.
    Check: verify m is prime and α < 0.5.

    Recall Check

    More short notes in this unit