GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - davin-core/hash-table: open-addressed, double-hashed hashable in C++

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitignore
.gitignore
 
 
CMakeLists.txt
CMakeLists.txt
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

Hash Table (C++)

A small hash table project I built to practice core data structure behavior in modern C++.

It supports:

  • insert / update
  • search
  • delete
  • printing table contents
  • resizing up and down

Internally it uses:

  • std::unique_ptr for memory safety
  • open addressing with linear probing
  • prime-sized table growth/shrink

Why this project exists

I wanted a version of a hash table that’s simple enough to read, but still close to how a real one works (collisions, probing, load factor, resizing).


Project layout

  • src/hash_table.h — structs + function declarations
  • src/hash_table.cpp — hash table logic
  • src/prime.h / src/prime.cpp — prime helpers for resize targets
  • src/main.cpp — console menu to try operations interactively

Build (Windows + CMake)

From the project root:

cmake -S . -B build
cmake --build build --config Release

Run:

.\build\Release\main.exe

Console menu

The app currently has options for:

  1. Insert/Update key-value
  2. Search key
  3. Delete key
  4. Print table
  5. Resize UP (manual)
  6. Resize DOWN (manual)
  7. Exit

Notes

  • unique_ptr handles memory cleanup automatically.
  • A delete operation is still needed for hash-table behavior (not memory behavior).
  • Search currently returns an empty string when not found, so empty-string values can be ambiguous.

Next improvements (optional)

  • Add tombstone handling for delete in linear probing
  • Return bool/std::optional<std::string> from search
  • Add unit tests for insert/search/delete/resize
  • Add automatic resize thresholds only (remove manual menu options)

License

MIT

About

open-addressed, double-hashed hashable in C++

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.