{"id":28285326,"url":"https://github.com/miguelgarcia21/cpp-dsa-toolkit","last_synced_at":"2025-07-10T16:12:25.791Z","repository":{"id":291123128,"uuid":"967266098","full_name":"MiguelGarcia21/cpp-dsa-toolkit","owner":"MiguelGarcia21","description":"A growing collection of C++ implementations for fundamental data structures. Built to practice, learn, and implement into any application that requires it.","archived":false,"fork":false,"pushed_at":"2025-05-10T15:26:22.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-16T07:44:09.884Z","etag":null,"topics":["cpp","doubly-linked-list","dsa","dsa-algorithm","hashmap","heap","linked-list"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MiguelGarcia21.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-16T07:29:03.000Z","updated_at":"2025-05-10T15:26:25.000Z","dependencies_parsed_at":"2025-05-02T15:27:00.028Z","dependency_job_id":"39f0adf1-9513-49d0-96d0-11cd4ffa7cf3","html_url":"https://github.com/MiguelGarcia21/cpp-dsa-toolkit","commit_stats":null,"previous_names":["miguelgarcia21/cpp-dsa-compendium","miguelgarcia21/cpp-dsa-toolkit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MiguelGarcia21/cpp-dsa-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelGarcia21%2Fcpp-dsa-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelGarcia21%2Fcpp-dsa-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelGarcia21%2Fcpp-dsa-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelGarcia21%2Fcpp-dsa-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MiguelGarcia21","download_url":"https://codeload.github.com/MiguelGarcia21/cpp-dsa-toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MiguelGarcia21%2Fcpp-dsa-toolkit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264605286,"owners_count":23636051,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","doubly-linked-list","dsa","dsa-algorithm","hashmap","heap","linked-list"],"created_at":"2025-05-21T18:16:59.235Z","updated_at":"2025-07-10T16:12:25.756Z","avatar_url":"https://github.com/MiguelGarcia21.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Templated C++ Data Structures Toolkit Library\n\nThis project is a modular and extensible **C++ template library** for classic data structures. Designed for performance and educational clarity, each data structure is implemented using generic programming principles with separate header (`.h`) and implementation (`.tpp`) files, and includes a dedicated Google Test suite.\n\n## 📁 Project Structure\n\n```\ninclude/        // Header files for each data structure\nsrc/            // Template implementations\ntests/          // Google Test unit tests\nbin/            // (suggested for compiled test binaries) \n.vscode/        // (local for VS Code configurations and testing)\n```\n\n## ✅ Supported Data Structures\n\n| Data Structure         | Header File           | Implementation File     | Test File                   |\n| ---------------------- | --------------------- | ----------------------- | --------------------------- |\n| AVL Tree               | `BinaryAVL.h`         | `BinaryAVL.tpp`         | `avl_test.cpp`              |\n| Binary Search Tree     | `BinaryTree.h`        | `BinaryTree.tpp`        | `binarytree_test.cpp`       |\n| Heap (Min/Max)         | `Heap.h`              | `Heap.tpp`              | `heap_test.cpp`             |\n| Singly Linked List     | `LinkedList.h`        | `LinkedList.tpp`        | `linkedlist_test.cpp`       |\n| Doubly Linked List     | `DoublyLinkedList.h`  | `DoublyLinkedList.tpp`  | `doublylinkedlist_test.cpp` |\n| Hash Table (open addr) | `HashTable.h`         | `HashTable.tpp`         | `hashtable_test.cpp`        |\n| Hash Table (chained)   | `HashTable_Chained.h` | `HashTable_Chained.tpp` | `hashtablechain_test.cpp`   |\n| General Node           | `Node.h`              | `Node.tpp`              | `node_test.cpp`             |\n\n---\n\n## 🧪 Google Test Coverage\n\nEach test file includes a suite of unit tests. Below is a summary of tested functionalities:\n\n### AVL Tree Tests\n\n| Test Name          | Description                           |\n| ------------------ | ------------------------------------- |\n| `InsertAndBalance` | Tests self-balancing insertions       |\n| `DeleteNode`       | Tests deletions and rebalancing       |\n| `RotationTest`     | Tests triggering left/right rotations |\n\n---\n\n### Binary Search Tree Tests\n\n| Test Name                      | Description                      |\n| ------------------------------ | -------------------------------- |\n| `InsertAndSearch`              | Validates insertion and search   |\n| `DeleteLeafNode`               | Deletion of leaf node            |\n| `DeleteNodeWithOneChild`       | Deletion when one child exists   |\n| `DeleteNodeWithTwoChildren`    | Replaces with in-order successor |\n| `DFSTraversal`, `BFSTraversal` | Verifies tree traversal orders   |\n\n---\n\n### Heap Tests\n\n| Test Name       | Description                      |\n| --------------- | -------------------------------- |\n| `InsertMaxHeap` | Tests max-heap insertions        |\n| `InsertMinHeap` | Tests min-heap insertions        |\n| `ExtractTop*`   | Tests extracting the top element |\n| `DeleteItem`    | Tests arbitrary deletion         |\n| `HeapifyWorks`  | Builds heap from a vector        |\n\n---\n\n### Linked List Tests\n\n| Test Name            | Description                  |\n| -------------------- | ---------------------------- |\n| `AddFront`, `AddEnd` | Insertion at front and end   |\n| `AddAt`              | Insert at arbitrary position |\n| `DeleteAt`           | Deletes at index             |\n| `Find`               | Searches for value           |\n\n---\n\n### Doubly Linked List Tests\n\n| Test Name      | Description                 |\n| -------------- | --------------------------- |\n| `Reverse`      | Reverses the list in-place  |\n| `PrintMethods` | Verifies output correctness |\n| `EdgeCases`    | Handles boundary conditions |\n\n---\n\n### Hash Table (Open Addressing) Tests\n\n| Test Name        | Description                          |\n| ---------------- | ------------------------------------ |\n| `InsertAndGet`   | Tests key-value insertion and lookup |\n| `OverwriteValue` | Replaces value of existing key       |\n| `ClearTable`     | Empties hash table                   |\n\n---\n\n### Hash Table (Chained) Tests\n\n| Test Name                  | Description                  |\n| -------------------------- | ---------------------------- |\n| `InsertAndSize`            | Adds multiple values per key |\n| `RemoveValue`, `RemoveKey` | Tests deletion logic         |\n| `PrintOutput`              | Checks console output format |\n\n---\n\n### Node Tests\n\n| Test Name                       | Description                          |\n| ------------------------------- | ------------------------------------ |\n| `Constructors`, `TreeStructure` | Validates node connectivity          |\n| `MoveSemantics`                 | Ensures move constructor correctness |\n\n---\n\n## ⏱ Time Complexity\n\nBelow are per-operation time complexities for each structure:\n\n### AVL Tree\n\n| Operation       | Time Complexity |\n| --------------- | --------------- |\n| Insert          | O(log n)        |\n| Delete          | O(log n)        |\n| Search          | O(log n)        |\n| Print (Inorder) | O(n)            |\n\n---\n\n### Binary Search Tree (Unbalanced)\n\n| Operation  | Time Complexity |\n| ---------- | --------------- |\n| Insert     | O(n) worst-case |\n| Delete     | O(n) worst-case |\n| Search     | O(n) worst-case |\n| Traversals | O(n)            |\n\n---\n\n### Heap\n\n| Operation | Time Complexity |\n| --------- | --------------- |\n| Insert    | O(log n)        |\n| Delete    | O(log n)        |\n| Top       | O(1)            |\n| Heapify   | O(n)            |\n\n---\n\n### Singly \u0026 Doubly Linked List\n\n| Operation        | Time Complexity |\n| ---------------- | --------------- |\n| Add Front/End    | O(1)            |\n| Add At           | O(n)            |\n| Delete At        | O(n)            |\n| Find             | O(n)            |\n| Reverse (Doubly) | O(n)            |\n\n---\n\n### Hash Table (Open Addressing)\n\n| Operation | Average Case | Worst Case |\n| --------- | ------------ | ---------- |\n| Insert    | O(1)         | O(n)       |\n| Delete    | O(1)         | O(n)       |\n| Search    | O(1)         | O(n)       |\n\n---\n\n### Hash Table (Chained)\n\n| Operation | Average Case | Worst Case |\n| --------- | ------------ | ---------- |\n| Insert    | O(1)         | O(n)       |\n| Delete    | O(1)         | O(n)       |\n| Search    | O(1)         | O(n)       |\n\n---\n\n## 🔧 Build \u0026 Run Tests\n\nMake sure you have [GoogleTest](https://github.com/google/googletest) installed and the folder bin created.\n\n```bash\ng++ -std=c++20 -Iinclude -Isrc -I\u003cgtest_path\u003e tests/avl_test.cpp -o bin/avl_test\n./bin/avl_test\n```\n\nYou can adapt the command for each test file as needed.\n\n---\n\n## 👨‍💻 Author\n\nThis project is built by Miguel Angel Garcia, Software Engineering student, aiming to learn and showcase core data structure implementations with best practices in C++ template design and testing.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelgarcia21%2Fcpp-dsa-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiguelgarcia21%2Fcpp-dsa-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiguelgarcia21%2Fcpp-dsa-toolkit/lists"}