← All projectsContacts App / completed
Contacts App
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
11 slots
13 slots
17 slots
03The original, in C++.
Contacts, a form, options, and the live table view, built on SFML.
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