← All projectsContacts App / completed

Contacts App

Project context · December 2023

Data Structures

A historical school project: a contacts manager exposing its underlying hash dictionary.

The submitted scope

  • Contacts interface and reusable controls.
  • A chained hash dictionary with resizing.
  • Visualization and selectable hash functions.

The delivery

A C++ / SFML application with contact editing and a visible hash table. The recorded app demonstrates collision chains and rehashing.

My contribution

I implemented the contacts interface, screen-state architecture, chained hash dictionary, resizing, and visualization.

Project evidence: Final-submission README

A C++ contacts app,
with its hash table on display.

2.88 avg steps to find7 longest chain0 empty

Jerry (818) 123-4567 → 8181234567 mod 7 = 2

0123456

Interactive reconstruction

01Every number has an address.

The app turns a phone number into a slot. Type any number to see where each of its two hash functions files it.

k mod n

8181234567 mod 72

golden ratio

floor(7 × frac(8181234567 × 0.6180339887))6

02Spread the chains.

Each bar is a slot; its height is how many contacts share it. Golden-ratio hashing evened the chains out, so finding a contact took fewer steps at every size.

7 slots

k mod n 2.88
golden ratio 2.40

11 slots

k mod n 2.24
golden ratio 2.08

13 slots

k mod n 1.80
golden ratio 1.72

17 slots

k mod n 1.84
golden ratio 1.56

03The original, in C++.

Contacts, a form, options, and the live table view, built on SFML.

Recorded April 4, 2024 · 1:18 · no audioOriginal recording ↗

My part

I implemented the contacts interface, screen-state architecture, chained hash dictionary, resizing, and visualization.

Shows

Data structures
Hash tablesSeparate chainingResizing & rehashingGolden-ratio hashing
Interface
Screen-state UIVisualizing a data structure

Built with

C++SFML