ITPEC FE Morning April 2023 Question 9

Source exam: ITPEC FE Morning April 2023Topic: Basic Theory & Math

ITPEC FE Morning April 2023 — Question 9 of 80

Hash Function (Division Method) — find array position using mod hash.

For number 54321 with hash mod(a1+a2+a3+a4+a5, 13):

  • Digits: 5, 4, 3, 2, 1
  • Sum: 5 + 4 + 3 + 2 + 1 = 15
  • Hash: 15 mod 13 = 2

Why not others:
- (a) 1 — would need digit sum of 14 (e.g., 95000)

- (c) 7 — would need digit sum of 7 or 20

- (d) 11 — would need digit sum of 11 or 24

Key rule: mod-based hashing: sum the digits, divide by table size, take remainder.

AI-generated — may contain errors

The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.

This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.