🚀 Complete Programming Roadmap
A production-ready, university-level learning resource for C++ and Java — covering everything from basics to advanced DSA, OOP, and system-level programming.
About This Repository
Who Is This For?
Repository Structure
C++ Curriculum
Java Curriculum
DSA Topic Index
How to Use This Repo
Complexity Quick Reference
Interview Patterns Cheat Sheet
Contributing
License
Complete Programming Roadmap is a structured, hands-on coding curriculum built for students, self-learners, and interview candidates. Every topic is explained at textbook depth with:
✅ Clean, commented code — every line explained
✅ Complexity analysis — Time & Space for every algorithm
✅ Interview-focused problems — LeetCode-style problems solved from scratch
✅ Dual-language coverage — C++ and Java side by side
✅ Beginner → Expert progression — structured learning path
Audience
Benefit
🧑🎓 CS Students
Lecture-quality explanations alongside working code
💼 Interview Prep
Comprehensive DSA with patterns & complexity analysis
🔄 Language Switchers
See the same algorithm in C++ and Java
🏫 Instructors
Ready-to-use teaching examples
🔁 Self-Learners
Clear progressive structure from basics to advanced
Complete-programming-roadmap/
│
├── cpp/ ← C++ complete curriculum
│ ├── basics/ ← Variables, control flow, functions, arrays
│ ├── intermediate/ ← Pointers, exceptions, file I/O, STL
│ ├── oops/ ← Classes, inheritance, polymorphism
│ ├── dsa/ ← Data Structures & Algorithms
│ │ ├── 01-basic-to-intermediate/
│ │ │ ├── arrays/
│ │ │ ├── linked-list/
│ │ │ ├── stack/
│ │ │ ├── queue/
│ │ │ ├── hashing/
│ │ │ └── searching-sorting/
│ │ └── 02-advanced/
│ │ ├── trees/
│ │ ├── heap/
│ │ ├── graphs/
│ │ ├── dynamic-programming/
│ │ └── tries/
│ └── advanced/ ← Templates, move semantics, multithreading
│
└── java/ ← Java complete curriculum
├── basics/ ← Variables, control flow, methods, arrays
├── intermediate/ ← Generics, exceptions, collections, I/O
├── oops/ ← Classes, interfaces, polymorphism
├── dsa/ ← Data Structures & Algorithms (Java)
│ ├── 01-basic-to-intermediate/
│ │ ├── arrays/
│ │ ├── linked-list/
│ │ ├── stack/
│ │ ├── hashing/
│ │ └── searching-sorting/
│ └── 02-advanced/
│ ├── trees/
│ ├── heap/
│ ├── graphs/
│ └── dynamic-programming/
└── advanced/ ← Concurrency, streams, functional programming
File
Topics
Key Concepts
01_variables.cpp
Data types, type casting, constants
int, float, char, sizeof, auto
02_control_flow.cpp
If-else, switch, loops, patterns
for, while, do-while, nested loops
03_functions_and_recursion.cpp
Functions, overloading, recursion, lambdas
Default args, pass-by-ref, tail recursion
04_arrays_and_strings.cpp
Arrays, vectors, string methods
std::vector, std::string, stringstream
File
Topics
Key Concepts
01_pointers_references.cpp
Pointers, references, dynamic memory
*, &, new, delete, pointer arithmetic
02_exception_handling.cpp
Exceptions, custom exception classes
try/catch/throw, noexcept, RAII
03_file_handling.cpp
File I/O, binary files, CSV
ifstream, ofstream, fstream
04_stl.cpp
STL containers & algorithms
vector, map, set, priority_queue, sort
File
Topics
01_oop.cpp
Classes, inheritance, polymorphism, abstraction, encapsulation, operator overloading
File
Topics
Time Complexity
01_array_traversal.cpp
Traversal, access
O(n)
03_array_deletion.cpp
Delete by index/value, remove duplicates
O(n)
04_linear_binary_search.cpp
Linear search, binary search, rotated array
O(n) / O(log n)
05_prefix_sum.cpp
Prefix sums, range queries
O(n) build + O(1) query
06_sliding_window.cpp
Fixed & variable sliding window
O(n)
07_two_pointer.cpp
Two-sum, rain water, 3-sum, container water
O(n)
08_kadane.cpp
Max subarray (Kadane's), circular variant
O(n)
09_matrix_operations.cpp
Transpose, rotate, spiral, sorted matrix search
O(n²)
File
Category
Topics
04_tree_extras.cpp
Trees
Level-order, zigzag, diameter, balanced check, max path sum
01_min_max_heap.cpp
Heap
Min/Max heap, build O(n), heap sort, K-th largest
04_shortest_path.cpp
Graphs
Dijkstra, Bellman-Ford, Floyd-Warshall
05_minimum_spanning_tree.cpp
Graphs
Kruskal (Union-Find), Prim (min-heap)
01_trie.cpp
Trie
Insert, search, autocomplete, prefix count, delete
01_fibonacci_memoization.cpp
DP
Memoization, tabulation
02_lcs_tabulation.cpp
DP
Longest Common Subsequence
03_01_knapsack.cpp
DP
0/1 Knapsack
File
Topics
01_advanced.cpp
Templates, variadic templates, move semantics, smart pointers (unique_ptr, shared_ptr, weak_ptr), lambdas, std::optional, std::variant, constexpr, multithreading
File
Topics
Variables.java
Primitive types, wrapper classes, var, constants, String, StringBuilder
ControlFlow.java
If-else, switch, loops
ArraysAndStrings.java
Arrays, ArrayList, String methods
FunctionsAndRecursion.java
Methods, recursion, varargs
File
Topics
OOP.java
Abstract classes, interfaces, inheritance, polymorphism, encapsulation
File
Topics
Arrays.java
Insert/delete, binary search, prefix sum, two-pointer, Kadane's, sliding window, matrix
LinkedList.java
Singly/Doubly LL, Floyd's cycle detection, palindrome, merge sort
StackAndQueue.java
Stack/Queue, balanced parens, NGE, sliding-window max, PriorityQueue
Hashing.java
HashMap/HashSet, custom keys, 7 interview problems
SortingAlgorithms.java
All 8 sorting algorithms
Trees.java
All traversals, BST, diameter, balance check, LCA
Heap.java
Min/Max heap, heap sort, K-th largest, top-K frequent, median stream
Graphs.java
BFS, DFS, Dijkstra, topological sort, Kruskal MST
File
Topics
Advanced.java
Generics, lambdas, Stream API, Optional, concurrency
Quick lookup — find any algorithm or data structure instantly.
Algorithm
Best
Average
Worst
Stable
C++
Java
Bubble Sort
O(n)
O(n²)
O(n²)
✅
02_all_sorting.cpp
SortingAlgorithms.java
Insertion Sort
O(n)
O(n²)
O(n²)
✅
same
same
Merge Sort
O(n log n)
O(n log n)
O(n log n)
✅
same
same
Quick Sort
O(n log n)
O(n log n)
O(n²)
❌
same
same
Heap Sort
O(n log n)
O(n log n)
O(n log n)
❌
same
same
Counting Sort
O(n+k)
O(n+k)
O(n+k)
✅
same
same
Radix Sort
O(dn)
O(dn)
O(dn)
✅
same
same
Topic
C++
Java
Trie: insert, search, autocomplete
01_trie.cpp
—
Language
Requirement
C++
GCC 9+ or Clang 10+ with C++17 support
Java
JDK 11+
C++
g++ -std=c++17 -O2 filename.cpp -o output
./output
Java
javac Filename.java
java Filename
Week 1–2: Basics (variables, control flow, functions, arrays)
Week 3–4: OOP (classes, inheritance, polymorphism)
Week 5–6: Intermediate (pointers/refs, STL/collections, exceptions)
Week 7–8: Arrays DSA (traversal, search, two-pointer, Kadane's)
Week 9–10: Linked Lists + Stack + Queue
Week 11: Hashing + Sorting algorithms
Week 12: Trees (binary tree, BST, traversals)
Week 13: Heap + Priority Queue
Week 14: Graphs (BFS, DFS, shortest path, MST)
Week 15: Dynamic Programming
Week 16: Trie + Advanced C++ / Java features
⏱️ Complexity Quick Reference
Data Structure
Access
Search
Insert
Delete
Space
Array
O(1)
O(n)
O(n)
O(n)
O(n)
Linked List
O(n)
O(n)
O(1)
O(1)*
O(n)
Stack
O(n)
O(n)
O(1)
O(1)
O(n)
Queue
O(n)
O(n)
O(1)
O(1)
O(n)
Hash Map
O(1)†
O(1)†
O(1)†
O(1)†
O(n)
Binary Search Tree
O(log n)
O(log n)
O(log n)
O(log n)
O(n)
Heap
O(1) top
O(n)
O(log n)
O(log n)
O(n)
Trie
O(L)
O(L)
O(L)
O(L)
O(N×A)
*O(1) with pointer to node. †Average case.
Algorithm
Best
Average
Worst
Space
Stable
Bubble Sort
O(n)
O(n²)
O(n²)
O(1)
✅
Selection Sort
O(n²)
O(n²)
O(n²)
O(1)
❌
Insertion Sort
O(n)
O(n²)
O(n²)
O(1)
✅
Merge Sort
O(n log n)
O(n log n)
O(n log n)
O(n)
✅
Quick Sort
O(n log n)
O(n log n)
O(n²)
O(log n)
❌
Heap Sort
O(n log n)
O(n log n)
O(n log n)
O(1)
❌
Counting Sort
O(n+k)
O(n+k)
O(n+k)
O(k)
✅
Radix Sort
O(dn)
O(dn)
O(dn)
O(n)
✅
🎯 Interview Patterns Cheat Sheet
Sliding Window → max/min subarray, longest substring
Two Pointer → sorted pair sum, rain water, remove duplicates
Prefix Sum → range queries, subarray sum = k
Monotonic Stack → next greater element, histogram area
Binary Search → sorted/rotated arrays, search in matrix
Dummy node → cleaner head insert/delete
Slow + Fast ptr → middle node, cycle detection (Floyd's)
Reverse in-place → prev, curr, next pattern
Two-pass → n-th from end
DFS (recursion) → height, diameter, path sum, LCA
BFS (queue) → level-order, zigzag, right-view
Post-order → bottom-up: balance check, LCA
Inorder BST → yields sorted sequence
BFS → shortest path (unweighted)
DFS → connected components, cycle detection, topo sort
Dijkstra → shortest path (non-negative weights)
Bellman-Ford → shortest path (negative weights, detect neg cycles)
Union-Find → Kruskal MST, number of islands
Memoization (top-down) → add cache to recursive solution
Tabulation (bottom-up) → build table iteratively
State definition → dp[i] = "answer for first i elements"
Transition → dp[i] = f(dp[i-1], dp[i-2], ...)
Contributions are welcome! Here's how you can help:
Fork the repository
Create a branch : git checkout -b feature/add-topic-name
Add your code following the existing style:
Header comment block with description and compile instructions
Inline comments explaining every non-trivial line
Complexity analysis (Time + Space)
Edge case handling
Submit a Pull Request with a clear description
C++: snake_case for variables/functions, PascalCase for classes
Java: camelCase for variables/methods, PascalCase for classes
Every file must compile without warnings with -Wall
This project is licensed under the MIT License — see the LICENSE file for details.
If this helped you prepare for interviews or learn programming, please consider giving it a ⭐ — it helps others find this resource!
Made with ❤️ for learners everywhere
Complete Programming Roadmap — C++ & Java — From Basics to Advanced DSA