HTML MIT

DSA

A well-organized repository covering core Data Structures and Algorithms, from fundamentals to advanced topics. It’s designed for systematic learning, coding interview preparation, and reference implementations, with topic-wise structure and clean, practical solutions

G

Gaurav14cs17

Dernière activité 14 août 2026
Gaurav14cs17/DSA

205

étoiles

34

forks

0

issues ouvertes

Ce README est souvent en anglais.

DSA Mastery - Data Structures & Algorithms

Typing SVG


Stars Forks Issues License

Live Docs


📐 Complexity Cheat Sheet

Complexity Chart

Algorithm Time Space When to Use
Binary Search O(log n) O(1) Sorted data, monotonic function
Two Pointers O(n) O(1) Sorted arrays, palindromes
Sliding Window O(n) O(k) Subarray/substring problems
BFS O(V+E) O(V) Shortest path (unweighted)
DFS O(V+E) O(V) Path finding, cycle detection
Dijkstra O((V+E)log V) O(V) Shortest path (weighted)
Merge Sort O(n log n) O(n) Stable sort needed
Quick Sort O(n log n) O(log n) General purpose sorting
DP (1D) O(n) O(n) Optimal substructure
DP (2D) O(n²) O(n²) Two-sequence problems

✨ What Makes This Special?

🎯 Comprehensive Coverage

  • 41 carefully curated topics

  • From basic arrays to advanced loop fusion

  • Interview-focused problem selection

📐 Mathematical Rigor

  • Formal proofs and derivations

  • Complexity analysis for every algorithm

  • Visual step-by-step walkthroughs

💻 Production-Ready Code

  • Clean, well-documented Python implementations

  • Multiple approaches for each problem

  • Optimized solutions with explanations

🗺️ Structured Learning Path

  • Progressive difficulty levels

  • Clear prerequisites and dependencies

  • Practice roadmaps for each topic


🗂️ Complete Topic Index

📦 Core Data Structures

# Topic Level Problems Description
01 Arrays 🟢 Easy 50+ Two pointers, prefix sum, matrix operations
02 Strings 🟢 Easy 50+ Pattern matching, palindromes, anagrams
03 Linked Lists 🟢 Easy 40+ Reversal, merge, cycle detection
04 Stacks 🟡 Medium 35+ Monotonic stack, expression evaluation
05 Queues 🟡 Medium 25+ BFS, deque, priority queues
06 Hash Tables 🟢 Easy 40+ Frequency counting, two sum pattern
07 Trees 🟡 Medium 60+ Traversal, construction, LCA
08 Binary Search Trees 🟡 Medium 25+ Validation, operations, balancing
09 Heaps 🟡 Medium 30+ Top-K, merge K streams, two heaps
10 Graphs 🔴 Hard 80+ BFS, DFS, shortest path, MST
11 Tries 🟡 Medium 15+ Autocomplete, word search
12 Segment Trees 🔴 Hard 15+ Range queries, lazy propagation
13 Union-Find 🟡 Medium 15+ Connected components, cycle detection

🧮 Essential Algorithms

# Topic Level Problems Description
14 Sorting 🟢 Easy 20+ Comparison sorts, counting sort, custom
15 Binary Search 🟡 Medium 40+ Sorted array, search on answer, 2D
16 Recursion 🟡 Medium 25+ Backtracking, memoization, D&C
17 Backtracking 🟡 Medium 30+ Permutations, subsets, N-Queens
18 Dynamic Programming 🔴 Hard 100+ 1D, 2D, knapsack, tree DP, bitmask
19 Greedy 🟡 Medium 25+ Interval scheduling, activity selection
20 Divide & Conquer 🟡 Medium 15+ Merge sort pattern, quick select
21 Bit Manipulation 🟡 Medium 25+ XOR tricks, bit counting, subsets

🎯 Problem-Solving Patterns

# Topic Level Problems Description
22 Two Pointers 🟢 Easy 30+ Opposite direction, same direction
23 Sliding Window 🟡 Medium 25+ Fixed size, variable size
24 Graph Algorithms 🔴 Hard 100+ Advanced BFS/DFS, network flow
25 Tree Algorithms 🔴 Hard 80+ Binary lifting, HLD, centroid
26 Sweep Line 🟡 Medium 20+ Event processing, interval problems
27 Advanced Trees 🔴 Hard 30+ AVL, Red-Black, B-Trees
28 String Algorithms 🔴 Hard 40+ KMP, Z-algorithm, suffix array
29 Computational Geometry 🔴 Hard 20+ Convex hull, line intersection

⚡ Advanced Topics

# Topic Level Problems Description
30 Number Theory 🔴 Hard 50+ GCD, prime sieve, modular arithmetic
31 Combinatorics 🔴 Hard 50+ Counting, generating functions
32 Game Theory 🔴 Hard 25+ Nim, Sprague-Grundy, minimax
33 Matrix Exponentiation 🔴 Hard 25+ Fast Fibonacci, linear recurrence
34 Sqrt Decomposition 🔴 Hard 20+ Mo's algorithm, block decomposition
35 Persistent DS 🔴 Hard 20+ Persistent segment tree, versioning
36 Randomized 🟡 Medium 25+ Reservoir sampling, skip lists
37 Interval Trees 🟡 Medium 30+ Interval scheduling, range updates
38 Online Algorithms 🔴 Hard 25+ LRU cache, streaming algorithms
39 Approximation 🔴 Hard 20+ Set cover, TSP approximation
40 DP Optimizations 🔴 Hard 60+ Convex hull trick, divide & conquer
41 Loop Fusion & Online 🔴 Hard 30+ Welford, Kadane, recurrence relations

🗺️ Complete Topic Overview

DSA Topics Overview - All 40 Topics

🚀 Learning Roadmap

DSA Learning Roadmap

📈 Suggested Weekly Plan

Week Focus Area Topics Goal
1-2 Foundations Arrays, Strings, Hash Maps Build strong basics
3-4 Core DS Linked Lists, Stacks, Queues Master linear structures
5-6 Search & Sort Binary Search, Sorting Understand divide & conquer
7-8 Recursion Recursion, Backtracking Think recursively
9-10 Trees Binary Trees, BST, Heaps Tree traversal mastery
11-12 Graphs BFS, DFS, Shortest Path Graph algorithms
13-16 DP 1D, 2D, Advanced DP Dynamic programming
17+ Advanced Segment Trees, Number Theory Competition level

🏆 Top Interview Problems

Must-Solve Before Your Interview

# Problem Topic Company
1 Two Sum Hash Map Google, Amazon, Meta
2 Valid Parentheses Stack All Companies
3 Merge Intervals Sorting Amazon, Microsoft
4 LRU Cache Design Meta, Amazon
5 Binary Tree Level Order BFS Google, Microsoft
6 Course Schedule Topological Sort Amazon, Google
7 Coin Change DP All Companies
8 Word Search Backtracking Meta, Amazon
9 Longest Substring Sliding Window All Companies
10 Clone Graph DFS Meta, Google

🤝 Contributing

Contributions are welcome! Here's how you can help:

  1. 🐛 Report bugs - Open an issue

  2. 💡 Suggest features - Share your ideas

  3. 📝 Improve docs - Fix typos, add examples

  4. 🔧 Submit PRs - Add problems, optimize solutions


📬 Connect

GitHub



If this repository helped you, please consider giving it a ⭐

Your support motivates continued development!



⭐ Star this repo if it helped you! ⭐

Made with ❤️ by Gaurav Goswami

Comprehensive DSA Guide • 830+ Problems • 41 Topics

Projets similaires

This is A complete DSA preparation Course. A DSA self-paced course for ultimate Interview and Placement Preparation

SCSSdata-structure-and-algorithm-coursedata-structuresdata-structures-and-algorithms
Hhelloworldbyprince
2,4 k étoiles553

📚A repository that contains all the Data Structures and Algorithms concepts and solutions to various problems in Python3 stored in a structured manner.👨‍💻🎯

Pythonalgorithmalgorithmscoding-interviews
SSamirPaulb
2,6 k étoiles539

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

JavaScriptalgorithmalgorithmscomputer-science
Ttrekhleb
196,8 k étoiles31 k