Collection of classic and advanced data structure implementations written in C/C++. The code is inspired by the course "Mastering Data Structures and Algorithms using C and C++" by Abdul Bari and is organised so each concept lives in its own folder.
- Examples for arrays, linked lists, trees, graphs, heaps and more
- Simple, portable C/C++ code with minimal dependencies
- Build every example at once with
make
- Suitable as a reference for students and hobbyists
Clone this repository and run make
to compile all programs:
git clone https://github.com/najm09/DataStructure.git
cd DataStructure
make
Compiled binaries will be placed next to their source files with the .app
extension.
Pull requests or fixes are always appreciated!
1. Arrays
-
- Dynamic memory allocation in heap and use of malloc function.
-
- Implementation of Array using recursive functions.
-
- Intersection of Two Arrays
- Union of Two Arrays
- Shift Merge and Reverse Operations on the Array
2. Matrices
3. LinkedList
4. Stack
- Stack Implementation code using Array as well as Link List
- Application of Stack in infix to postfix Conversion
5. Queue
- Implementation code for Queue using Array, Link List, Stack.
- Circular Queue
- DEQueue
- Recursive Queue
6. binarytree
- Nodes in a binary tree
- Level Order Traversal using Queue
- Post Order Traversal using one stack without recursion
- Recursive Inorder, Postorder and Preorder traversal
7. BST
- Operations Binary search tree
- Recursive implementation of binary search tree
8. AVL
- Performing Rotation while Generation of BST