Welcome to the Data Structures Library in C! This repository contains implementations of various data structures and algorithms in C, including linked lists, queues, stacks, binary trees, heaps, and more.
- Linked List: Single Linked List, Doubly Linked List
- Queue: Circular Queue, Double Ended Queue
- Stack: Basic Stack operations
- Binary Tree: Basic Binary Tree operations including insertion, deletion, traversal
- Heap: Min-Heap, Max_Heap
- Hashmap: Supports Different Key-Value Types
- Graph: Adjacency Matrix, Adjacency List
To get started with this repository, you'll need to have a C compiler installed on your system. You can compile the programs using gcc or any other C compiler.
-
Clone the repository:
git clone https://github.com/pavank1301/Data-Structures-C.git
-
Navigate to the directory:
cd Data-Structures-C
Each implementation is in its respective file:
- Linked List:
linked_list.candlinked_list.h - Queue:
queue.candqueue.h - Stack:
stack.candstack.h - Binary Tree:
binary_tree.candbinary_tree.h - Heap:
heap.candheap.h
Refer to the specific implementation files for details on the functions and their usage.
#include "binary_tree.h"
#include <stdio.h>
int main() {
TreeNode* root = NULL;
insertTreeNode(&root, 10);
insertTreeNode(&root, 20);
insertTreeNode(&root, 30);
printf("Inorder traversal: ");
inorder(root);
printf("\n");
freeTree(root);
return 0;
}Contributions are welcome! If you have suggestions, improvements, or bug fixes, please submit a pull request. For significant changes, open an issue first to discuss.
- Fork the repository
- Create a new branch (git checkout -b feature-branch)
- Make your changes
- Commit your changes (git commit -am 'Add new feature')
- Push to the branch (git push origin feature-branch)
- Create a new Pull Request