DSA Codes
Here you’ll find my structured collection of Data Structures and Algorithms
code implementations. These are organized by topic and link directly to my GitHub
repositories for easy access.
Arrays
Problem |
Link |
Print Array |
Link |
Linear Search |
Link |
Largest In Array |
Link |
Smallest In Array |
Link |
Second Largest |
Link |
Second Smallest |
Link |
Binary Search |
Link |
Print Pairs : (Logic of Pairs) |
Link |
Max Sum Pair |
Link |
Reverse Array |
Link |
Print Sub-Arrays |
Link |
Max Sum Sub-Array (Brute-Force) |
Link |
Max Sum Sub-Array (Kadane's Algorithm) |
Link |
Max Sum Sub-Array (Prefix Sum Approach) |
Link |
Buy-Sell Stock-1 |
Link |
Buy-Sell Stock-2 |
Link |
Trap-Rain-Water |
Link |
Sorting Techniques
Problem |
Link |
Bubble Sort |
Link |
Selection Sort |
Link |
Insertion Sort |
Link |
Count Sort |
Link |
BuiltIn Sort |
Link |
Matrix 2-D Arrays
Problem |
Link |
Print Matrix |
Link |
Search In Matrix |
Link |
Largest In Matrix |
Link |
Smallest In Matrix |
Link |
Sum Of Diagonal |
Link |
Transpose Of Matrix |
Link |
Print Spiral |
Link |
Search in Sorted Matrix (Brute-Force) |
Link |
Search in Sorted Matrix (Binary-Search) |
Link |
Search in Sorted Matrix (StairCase-Search-Variation-1) |
Link |
Search in Sorted Matrix (StairCase-Search-Variation-2) |
Link |
Strings
Problem |
Link |
String Basics |
Link |
String Length |
Link |
String Concatination |
Link |
String charAt() Method |
Link |
String Palindrome |
Link |
Shortest Path |
Link |
String Equals |
Link |
String SubString |
Link |
Lexiographically Largest String |
Link |
StringBuilder Basics |
Link |
ToUpperCase |
Link |
String Compression |
Link |
VowelsToLowerCase |
Link |
String Anagrams |
Link |
Bit Manipulation
Problem |
Link |
Bit-Manipulation Basics |
Link |
CheckEvenOdd |
Link |
Get=ith-bit |
Link |
Set-ith-bit |
Link |
Clear-ith-bit |
Link |
Update-ith-bit |
Link |
ClearLast-i-bits |
Link |
ClearRangeOfBits |
Link |
Check-If-Number-Is-PowerOf-2 |
Link |
Count Set Bits |
Link |
Fast Exponentiation |
Link |
Swap Numbers |
Link |
Recursion
Problem |
Link |
Print N to 1 |
Link |
Print 1 to N |
Link |
Factorial |
Link |
Sum Of Natural Numbers |
Link |
Fibonacci |
Link |
Check If Array is Sorted |
Link |
First Occurrence |
Link |
Last Occurrence |
Link |
Find Power |
Link |
GCD |
Link |
Tiling Problem |
Link |
Remove Duplicates From String |
Link |
Friends Pairing Problem |
Link |
Binary Strings Problem |
Link |
Find All Occurrences |
Link |
Digit Seperation |
Link |
Number To String |
Link |
Tower Of Hanoi |
Link |
Binary Search Recursive |
Link |
Divide & Conquer
Problem |
Link |
Merge-Sort |
Link |
Quick-Sort |
Link |
Search In a Rotated Sorted Array |
Link |
Backtracking
Problem |
Link |
Change Array |
Link |
Find Subsets |
Link |
Find Permutations |
Link |
Grid Ways |
Link |
ArrayList
Problem |
Link |
Operations |
Link |
Print Reverse |
Link |
Reverse ArrayList |
Link |
Find Maximum in ArrayList |
Link |
Containter with Most Water - Brute Force |
Link |
Container with Most Water - Optimized |
Link |
Pair-Sum-1 - Brute Force |
Link |
Pair-Sum-1 - Optimized |
Link |
Pair-Sum-2 |
Link |
LinkedList
Problem |
Link |
Basics of LinkedList |
Link |
Dynamic Creation LinkedList |
Link |
Insert LinkedList |
Link |
Find Size LinkedList |
Link |
Search in LinkedList |
Link |
Recursive Search LinkedList |
Link |
Remove Node LinkedList |
Link |
Reverse LinkedList |
Link |
Find Middle Node |
Link |
Find Middle Node - Optimized |
Link |
Palindrome LinkedList |
Link |
Detect Cycle LinkedList |
Link |
Remove Cycle LinkedList |
Link |
Built-in LinkedList |
Link |
ZigZag LinkedList |
Link |
Stack
Problem |
Link |
Stack Implementation using ArrayList |
Link |
Stack Implementation using LinkedList |
Link |
Built-in Stack |
Link |
Push at the Bottom of Stack |
Link |
Reverse a String using Stack |
Link |
Reverse a Stack |
Link |
Next Greater Element |
Link |
Stock Span Problem |
Link |
Valid Parentheses |
Link |
Queue
Problem |
Link |
Implement Using Array - Queue |
Link |
Implement Circular Queue Using Array - Queue |
Link |
Implement Using LinkedList - Queue |
Link |
Implement Using Two Stacks - Queue |
Link |
Built-in Queue - Queue |
Link |
First Non-Repeating Character - Queue |
Link |
InterLeave Two Halves of Queue - Queue |
Link |
Queue Reversal - Queue |
Link |
Deque Built-in - Queue |
Link |
Implement Queue Using Deque - Queue |
Link |
Greedy
Problem |
Link |
Activity Selection |
Link |
Fractional Knapsack |
Link |
Maximum Absolute Difference Pairs |
Link |
Maximum Length Chain Of Pairs |
Link |
Indian Coins |
Link |
Job Sequencing |
Link |
Chocola Problem |
Link |