Skip to content

About

C++ implementations of core data structures (linked lists, stacks, queues, trees) with a focus on efficiency, memory management, and algorithmic problem-solving.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

C++ Data Structures

Reusable implementations of core data structures and algorithms in modern C++, with small programs that exercise their trade-offs in practice.

This repository is organized around ideas rather than a course timeline. The public-facing code lives in include/, examples/, and tests/; the original exploratory material is kept in archive/ for reference.

What this demonstrates

  • Manual memory ownership, destructors, explicit copy/move policies, and exception-safe resizing
  • Singly and doubly linked lists, a dynamic array, and a circular-buffer deque
  • Binary search trees and AVL trees with rotations, deletion, and traversals
  • A vector-backed set and a separate-chaining hash set with rehashing
  • Heap-based priority queues and generic insertion, merge, and quick sort
  • Complexity analysis backed by a repeatable benchmark executable
  • Testable, header-only components with a minimal CMake build

Repository map

include/ds/       reusable data structures and algorithms
examples/         focused demos and performance experiments
tests/            executable smoke tests
docs/             design notes and complexity reference
archive/          original coursework and exploratory notes

Quick start

cmake -S . -B build
cmake --build build
ctest --test-dir build --output-on-failure
./build/benchmark_sets
./build/priority_queue_demo

The library is header-only and requires C++17. No third-party dependencies are needed.

Complexity snapshot

Structure Lookup Insert Remove Notes
DynamicArray O(1) by index O(1) amortized O(n) contiguous storage
SinglyLinkedList O(n) O(1) at front O(1) at front one link per node
DoublyLinkedList O(n) O(1) at ends O(1) at ends bidirectional links
BinarySearchTree O(h) O(h) O(h) h can become n
AvlTree O(log n) O(log n) O(log n) rotations maintain balance
HashSet O(1) average O(1) average O(1) average separate chaining
PriorityQueue O(1) max O(log n) O(log n) binary max-heap

For implementation details, see docs/design-notes.md.

About

C++ implementations of core data structures (linked lists, stacks, queues, trees) with a focus on efficiency, memory management, and algorithmic problem-solving.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages