This repository contains implementations of various data structures in C, based on the concepts and examples presented in the book "Fundamentals of Data Structures in C" by Ellis Horowitz, Sartaj Sahni, and Susan Anderson-Freed.
Each data structure is implemented in a separate directory, with a main.c
file that demonstrates the usage of the data structure. For example, the stack of general data type using arrays is in the stack/general_stack
directory, with the main.c
file demonstrating the usage of the stack.
The Makefile
in the root directory can be used to compile and run the demo programs for each data structure according to the TARGET
specified, you can find them in the usage section below.
- Stacks
- Queues
- Linked Lists
- Trees
- Sets
- Disjoint Sets 📂
- Graphs
- Hashing
- Heap Structures
- Stack of
general
data type 📃make test TARGET=general_stack
- Stack of
integer
data type 📃make test TARGET=int_stack
- Queue of
general
data type using arrays with N-1 slots 📃make test TARGET=general_circular_array_n-1_slot_queue
- Queue of
general
data type using arrays with N slots 📃make test TARGET=general_circular_array_n_slot_queue
- Circular of
general
data type using single linked list 📃make test TARGET=general_single_list_queue
- Singly linked list of
general
data type 📃make test TARGET=general_single_linked_list
- Singly linked list of
integer
data type 📃make test TARGET=int_single_linked_list
- Doubly linked list of
general
data type 📃make test TARGET=general_double_linked_list
- Doubly linked list of
integer
data type 📃make test TARGET=int_double_linked_list
- Disjoint sets 📃
make test TARGET=disjoint_set
- BFS 📃
make test TARGET=graph_bfs
- DFS 📃
make test TARGET=graph_dfs
- Kruskal's Minimum Spanning Tree 📃
make test TARGET=Kruskal_mst
- Hash table using linked list 📃
make test TARGET=hashtable_list
- Hash table using arrays 📃
make test TARGET=hashtable_array
- If collision occurs during insertion, the key is inserted into the next available slot according to linear probing.
- Min heap of
general
data type 📃make test TARGET=general_min_heap
- Min heap of
integer
data type 📃make test TARGET=int_min_heap
- Max heap of
integer
data type 📃make test TARGET=int_max_heap
- Min-max heap of
general
data type 📃make test TARGET=general_min_max_heap
- Deap of
general
data type 📃make test TARGET=general_deap
- Min leftist tree of
general
data type 📃make test TARGET=general_min_leftist_tree
- Binomial heap 📃
make test TARGET=binomial_heap
- Fibonacci heap 📃
make test TARGET=fibonacci_heap
make clean
Inspired by and references from: