Welcome to the DSA Code Repository! This repository contains implementations of various Data Structures and Algorithms in multiple programming languages. It is designed to help students, programmers, and coding enthusiasts learn and practice DSA concepts effectively.
This repository serves as a comprehensive collection of important DSA problems, solutions, and explanations. It is structured to help beginners get started and allow experienced coders to refine their skills.
- C
- C++
- Basic Algorithms: Sorting, Searching, Recursion, Backtracking
- Data Structures:
- Arrays (insert, delete, search, traverse)
- Linked Lists (singly, doubly, circular) with head & tail pointers
- Stacks (array-based and linked list-based)
- Queues (linear, circular, deque, priority queue)
- Trees (Binary Search Tree with traversals)
- Graphs (representation, BFS, DFS)
- Hash Tables (chaining and linear probing)
- Heaps (max heap, min heap)
- Expression Handling:
- Conversions: Infix ↔ Postfix ↔ Prefix (all 6 conversions)
- Evaluation: Infix, Postfix, and Prefix expression evaluation
- Advanced Topics: Dynamic Programming, Greedy Algorithms, Graph Algorithms (BFS, DFS, Dijkstra's, Kruskal's, Prim's), Bit Manipulation
- Competitive Programming: Frequently asked DSA questions in coding interviews
DSA-Codes/
├── arrays/ # Array operations (insert, delete, search, traverse)
├── linked_lists/ # All types of linked lists
│ ├── singly_linked_list.c # Singly linked list with head & tail pointers
│ ├── doubly_linked_list.c # Doubly linked list with head & tail pointers
│ ├── circular_linked_list.c # Circular linked list implementation
│ ├── stack_using_linked_list.c # Stack implementation using linked list
│ └── queue_using_linked_list.c # Queue implementation using linked list
├── stack/ # Stack implementations and applications
│ ├── stack.c # Array-based stack
│ ├── expression_conversion.c # Infix, Prefix, Postfix conversions
│ └── expression_evaluation.c # Expression evaluation (all formats)
├── queue/ # Various queue implementations
│ ├── linear_queue.c # Linear queue
│ ├── circular_queue.c # Circular queue
│ ├── doubly_ended_queue.c # Deque (insert/delete from both ends)
│ └── priority_queue.c # Priority queue implementation
├── trees/ # Binary Search Tree (BST) with traversals
├── graphs/ # Graph representation, BFS, DFS
├── sorting/ # Bubble, Selection, Insertion, Merge, Quick Sort
├── searching/ # Linear Search, Binary Search
├── recursion/ # Factorial, Fibonacci, Tower of Hanoi, GCD
├── hashing/ # Hash tables with chaining and linear probing
├── heap/ # Max heap, Min heap, Heap Sort
├── strings/ # String operations, pattern matching, palindrome
├── bit_manipulation/ # Bit operations and manipulation tricks
├── Dynamic_memory_allocation/ # malloc, calloc, realloc examples
└── README.md # This file
Each topic folder contains:
- Working C code examples with interactive menus
- Individual
README.mdwith compilation instructions - Time complexity analysis and algorithm explanations
- Real-world applications and use cases
-
Clone the repository:
git clone https://github.com/DigarSingh/dsa-codes.git
-
Navigate to the directory:
cd dsa-codes -
Open the files in your preferred code editor and run the code.
Contributions are always welcome! Follow these steps to contribute:
-
Fork the repository.
-
Create a new branch:
git checkout -b feature-branch
-
Add your code and commit changes:
git commit -m "Added new DSA solution" -
Push to your forked repository:
git push origin feature-branch
-
Open a Pull Request.
Happy Coding! 🚀