Skip to content

A structured Java Data Structures and Algorithms repository containing solved problems with multiple approaches, optimized solutions, and clear explanations. Focused on problem-solving, time–space complexity analysis, and writing clean, efficient Java code

Notifications You must be signed in to change notification settings

karan-hub/Java-DSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 ZERO TO HERO JAVA WITH DSA ☕︎


📈 Progress


🛠️ Step 1: Learn the Basics

Progress: 19 / 31

🎓 Lec 1: Things to Know in C++/Java/Python or any language

Progress: 9 / 9

🔢 📝 Topic 🎯 Difficulty Status
1️⃣ User Input / Output 🟢 Easy ✅ Done
2️⃣ Data Types 🟢 Easy ✅ Done
3️⃣ If Else statements 🟢 Easy ✅ Done
4️⃣ Switch Statement 🟢 Easy ✅ Done
5️⃣ What are arrays, strings? 🟢 Easy ✅ Done
6️⃣ For loops 🟢 Easy ✅ Done
7️⃣ While loops 🟢 Easy ✅ Done
8️⃣ Functions (Pass by Reference and Value) 🟢 Easy ✅ Done
9️⃣ Time Complexity [Basics] 🟢 Easy ✅ Done

🧠 Lec 2: Build-up Logical Thinking

Progress: 1 / 1


📚 Lec 3: Learn STL/Java-Collections or similar thing in your language

Progress: 1 / 1

🔢 📝 Topic 🎯 Difficulty Status
1️⃣ Java 🟡 Medium ✅ Done

🔢 Lec 4: Know Basic Maths

Progress: 7 / 7

🔢 📝 Topic 🎯 Difficulty Status
1️⃣ Count Digits 🟢 Easy ✅ Done
2️⃣ Reverse a Number 🟢 Easy ✅ Done
3️⃣ Check Palindrome 🟢 Easy ✅ Done
4️⃣ GCD Or HCF 🟢 Easy ✅ Done
5️⃣ Armstrong Numbers 🟢 Easy ✅ Done
6️⃣ Print all Divisors 🟢 Easy ✅ Done
7️⃣ Check for Prime 🟢 Easy ✅ Done

🔄 Step 2: Learn Important Sorting Techniques

Progress: 3 / 3

📋 Lec 1: Sorting-I

Progress: 3 / 3

🔢 📝 Topic 🎯 Difficulty Status
1️⃣ Selection Sort 🟢 Easy ✅ Done
2️⃣ Bubble Sort 🟢 Easy ✅ Done
3️⃣ Insertion Sort 🟢 Easy ✅ Done

📋 Lec 2: Cyclic Sort

Progress: 7 / 7

🔢 📝 Topic 🎯 Difficulty Status
1️⃣ Cyclic Sort 🟢 Easy ✅ Done
2️⃣ Find All Duplicates 🟡 Medium ✅ Done
3️⃣ Find All Missing Numbers 🟡 Medium ✅ Done
4️⃣ Find Duplicate 🟡 Medium ✅ Done
5️⃣ Missing Number 🟢 Easy ✅ Done
6️⃣ First Missing Positive 🔴 Hard ✅ Done
7️⃣ Set Mismatch 🟡 Medium ✅ Done

🧩 Step 3: Solve Problems on Arrays [Easy → Medium → Hard]

Progress: 40 / 40

🟢 Lec 1: Easy

Progress: 14 / 14

🔢 📝 Topic 🎯 Difficulty Status
1️⃣ Largest Element in an Array 🟢 Easy ✅ Done
2️⃣ Second Largest Element in an Array 🟢 Easy ✅ Done
3️⃣ Check if the array is sorted 🟢 Easy ✅ Done
4️⃣ Remove duplicates from Sorted array 🟢 Easy ✅ Done
5️⃣ Left Rotate an array by one place 🟢 Easy ✅ Done
6️⃣ Left rotate an array by D places 🟢 Easy ✅ Done
7️⃣ Move Zeros to end 🟢 Easy ✅ Done
8️⃣ Linear Search 🟢 Easy ✅ Done
9️⃣ Find the Union 🟡 Medium ✅ Done
🔟 Find missing number in an array 🟢 Easy ✅ Done
1️⃣1️⃣ Maximum Consecutive Ones 🟢 Easy ✅ Done
1️⃣2️⃣ Find the number that appears once 🟡 Medium ✅ Done
1️⃣3️⃣ Longest subarray with given sum K (positives) 🟡 Medium ✅ Done
1️⃣4️⃣ Longest subarray with sum K (Positives + Negatives) 🟡 Medium ✅ Done

🟡 Lec 2: Medium

Progress: 14 / 14

🔢 📝 Topic 🎯 Difficulty Status
1️⃣ 2Sum Problem 🟡 Medium ✅ Done
2️⃣ Sort an array of 0's, 1's, and 2's 🟡 Medium ✅ Done
3️⃣ Majority Element (>RecursionBasic/2 times) 🟢 Easy ✅ Done
4️⃣ Kadane's Algorithm 🟢 Easy ✅ Done
5️⃣ Print subarray with maximum subarray sum 🟡 Medium ✅ Done
6️⃣ Stock Buy and Sell 🟢 Easy ✅ Done
7️⃣ Rearrange the array in alternating positive and negative items 🟡 Medium ✅ Done
8️⃣ Next Permutation 🟡 Medium ✅ Done
9️⃣ Leaders in an Array problem 🟢 Easy ✅ Done
🔟 Longest Consecutive Sequence in an Array 🟡 Medium ✅ Done
1️⃣1️⃣ Set Matrix Zeros 🟡 Medium ✅ Done
1️⃣2️⃣ Rotate Matrix by 90 degrees 🟡 Medium ✅ Done
1️⃣3️⃣ Print the matrix in spiral manner 🟡 Medium ✅ Done
1️⃣4️⃣ Count subarrays with given sum 🟢 Easy ✅ Done

🔴 Lec 3: Hard

Progress: 12 / 12

🔢 📝 Topic 🎯 Difficulty Status
1️⃣ Pascal's Triangle 🟡 Medium ✅ Done
2️⃣ Majority Element (RecursionBasic/3 times) 🟡 Medium ✅ Done
3️⃣ 3-Sum Problem 🟡 Medium ✅ Done
4️⃣ 4-Sum Problem 🔴 Hard ✅ Done
5️⃣ Largest Subarray with 0 Sum 🟡 Medium ✅ Done
6️⃣ Count number of subarrays with given xor K 🔴 Hard ✅ Done
7️⃣ Merge Overlapping Subintervals 🟡 Medium ✅ Done
8️⃣ Merge two sorted arrays without extra space 🟡 Medium ✅ Done
9️⃣ Find the repeating and missing number 🔴 Hard ✅ Done
🔟 Count Inversions 🔴 Hard ✅ Done
1️⃣1️⃣ Reverse Pairs 🔴 Hard ✅ Done
1️⃣2️⃣ Maximum Product Subarray 🟢 Easy ✅ Done

🔍 Step 4: Binary Search [1D, 2D Arrays, Search Space]

Progress: 12 / 12

📊 Lec 1: BS on 1D Arrays

Progress: 9 / 9

🔢 📝 Topic 🎯 Difficulty Status
1️⃣ Binary Search to find X in sorted array 🟢 Easy ✅ Done
2️⃣ Implement Lower Bound 🟢 Easy ✅ Done
3️⃣ Implement Upper Bound 🟢 Easy ✅ Done
4️⃣ Search Insert Position 🟢 Easy ✅ Done
5️⃣ Floor/Ceil in Sorted Array 🟡 Medium ✅ Done
6️⃣ Find the first or last occurrence of a number 🟢 Easy ✅ Done
7️⃣ Count occurrences of a number in a sorted array 🟢 Easy ✅ Done
8️⃣ Search in Rotated Sorted Array I 🟡 Medium ✅ Done
9️⃣ Search in Rotated Sorted Array II 🟡 Medium ✅ Done

🧮 Lec 2: BS on Answers

Progress: 3 / 3

🔢 📝 Topic 🎯 Difficulty Status
1️⃣ Find square root of a number in log RecursionBasic 🟡 Medium ✅ Done
2️⃣ Find the Nth root of a number using binary search 🟡 Medium ✅ Done
3️⃣ Koko Eating Bananas 🟡 Medium ✅ Done

🎉 Keep Going! You're doing amazing!

About

A structured Java Data Structures and Algorithms repository containing solved problems with multiple approaches, optimized solutions, and clear explanations. Focused on problem-solving, time–space complexity analysis, and writing clean, efficient Java code

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published