Hashing-Based Symbol Table Addressing: Computing the Initial Position for Key 27

Hashing-Based Symbol Table Addressing: Computing the Initial Position for Key 27

Verified Sources
Nov 3, 2026

A symbol table using hashing stores each key (k)(k) in a table slot determined by a hash function h(k)h(k). For division hashing, a common hash function is h(k)=k mod mh(k)=k \bmod m, where mm is the table size, and the output is an index in the range [0,m−1][0, m-1]. This modulo/remainder approach is standard for mapping keys to table addresses. 2

Key idea: the “initial position” is simply h(27)=27 mod 10h(27)=27 \bmod 10 for m=10m=10.

We are given the options:

  • (i) 55
  • (ii) 77
  • (iii) 66
  • (iv) 88

Footnotes

  1. Hash function - Wikipedia - Describes using modulo in hashing for mapping keys into table indices. ↩

  2. 8.1. Hashing — CS3 Coursenotes (ODSA) - States hashing maps keys to positions and typical indexing for MM slots. ↩ ↩2

Compute the initial hash table position for key 27

  1. 1
    Step 1

    Given m=10m=10 and h(k)=k mod 10h(k)=k \bmod 10, compute h(27)=27 mod 10h(27)=27 \bmod 10.

  2. 2
    Step 2

    Since 10×2=2010\times 2=20 and 27−20=727-20=7, the remainder is 77.

  3. 3
    Step 3

    Therefore, h(27)=7h(27)=7, which corresponds to option (ii).

So the correct initial position is (ii) 77.

This follows directly from the definition of modulo as the remainder after division: abmodn=ra \\bmod n = r where a=nq+ra = nq + r and 0ler<n0\\le r < n.

Footnotes

  1. Modulo Calculator — definition of remainder - Explains abmodn=ra\\bmod n=r via a=nq+ra=nq+r and the remainder interpretation. ↩

Pro Tip

For h(k)=k mod mh(k)=k\bmod m, you can compute quickly by finding the remainder of kk after removing the largest multiple of mm not exceeding kk—no need for long division.

Footnotes

  1. Hash function - Wikipedia - Describes using modulo in hashing for mapping keys into table indices. ↩

Indexing convention

Most hashing descriptions index slots from 00 to m−1m-1 when using modulo, so the modulo remainder is used directly as the address in that range. If a course uses 11-based indexing, the answer would shift by +1+1, but the modulo definition itself still yields remainder 77.

Footnotes

  1. 8.1. Hashing — CS3 Coursenotes (ODSA) - States hashing maps keys to positions and typical indexing for MM slots. ↩

From key to address in a hashed symbol table

Hashing

1

Apply h(k)=k mod mh(k)=k\bmod m to map the key to a slot."

Initial position

2

Use the remainder as the first candidate table index."

Collision handling (if needed)

3

If the slot is taken, a collision resolution strategy determines the next probe address."

Footnotes

  1. Symbol Table and Hashing (lecture handout PDF) - Defines collisions and collision resolution policies. ↩

Multiple-choice options vs computed remainder

Computed h(27)=27 mod 10=7h(27)=27\bmod 10=7

Quick conceptual check

Knowledge Check

Question 1 of 4
Q1Single choice

For a symbol table of size 1010 using h(k)=k mod 10h(k)=k\bmod 10, what is the initial position for key 2727?