https://github.com/frank-wong-cn/datastructures-cpp
(Re)learning data structures.
https://github.com/frank-wong-cn/datastructures-cpp
algorithm avl-tree data-structures hashmap linked-list
Last synced: about 2 months ago
JSON representation
(Re)learning data structures.
- Host: GitHub
- URL: https://github.com/frank-wong-cn/datastructures-cpp
- Owner: Frank-Wong-CN
- License: gpl-3.0
- Created: 2021-10-12T14:24:29.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-24T09:39:03.000Z (almost 4 years ago)
- Last Synced: 2025-01-17T16:58:14.245Z (11 months ago)
- Topics: algorithm, avl-tree, data-structures, hashmap, linked-list
- Language: C
- Homepage:
- Size: 223 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# C++ Implementations of Common Data Structures
This implementation is partially based on *Data Structures and Algorithm Analysis in C Second Edition* by Mark Allen Weiss.
## Content
Ch2: Intro to Algorithms, a few utility functions to help me calculate and display execution time of a function
Ch3: Linked List, Stack and Queue
Ch4: N-ary Tree, Binary Tree, Binary Search Tree, AVL Tree, B+Tree
Ch5: Hashing (Not Implemented, but I implemented my own HashMap using DJB hash function)
Ch6: Heap and Priority Queue (Not Implemented)
Ch7: String (Implemented) and Multi-Dimensional Array (Not Implemented)
Ch8: Adjacency List as Graph (Partially Implemented)
Ch9: Sorting Algorithm
- BubbleSort
- RadixSort
- InsertionSort, ShellSort
Ch10: Indexing Algorithm (Not Implemented)
Ch11: Advanced Structures and Designing Algorithms (Not Implemented)
## Directories
ChX: Chapter files and codes
CommonDS_v2: Refactored DS library for other uses
HashMap: An hash map implementation using AVL tree and linked list
Utils.hpp: Utility functions such as memory, log, timer and random array generator
## How to use for other purposes
Download CommonDS_v2/CommonDS_v2. The ds.h is the interface header file including all data structure headers and sources. Users can also include only needed headers and sources instead of ds.h.
ds.h also defines several macros for shorter class names and function names. The reason for such long original names is to avoid name collisions. Users may customize their own shorter versions by renaming the macros in ds.h.
To expand node capabilities, create custom node_impl* or tnode_impl* file and replace the included one in ds.h.