All DS & Algorithms are implemented in Java (for educational purposes)
- ArrayList
- LinkedList
- Vector & Stack
- Queue
- Deque
- Map
- HashCode & Equals
- Comparators & Comparable
- Tree
- Graph
- Priority Queue
- Trie
- Segment Tree
- Arrays
- Anagram Occurrence GFG
- Coins Of Geekland
- K Sorted Array GFG
- Maximum Sum Subarray of size k GFG
- Min Subsets with Consecutive Numbers GFG
- Smallest Positive Number that cannot be represented as Sum
- Geek Classmates GFG
- Majority Element GFG
- Replace 0's With X's GFG
- Triplet Sum GFG
- Longest Consecutive Sequence GFG
- Kadane's Algorithm GFG
- Best time to buy and sell stocks - l LeetCode
- Best time to buy and sell stocks - ll GFG
- Trapping Rain Water GFG
- Container with Most Water LeetCode
- Majority Element 2 LeetCode
- Majority Element General PepCoding
- Next Greator Element LeetCode
- Max Chunks GFG
- String Multiplication LeetCode
- Pascal's Triangle LeetCode
- Next Permutation GFG
- Partition Label LeetCode
- Sorting
- BinarySearch
- Search Element using Binary Search GFG
- Ceil and Floor in array
- Book Allocation GFG
- Find Element in Infinite Sorted Array GFG
- Matrix Search GFG
- Min Number in sorted rotated array GFG
- Missing Element of AP GFG
- Pivot Element in sorted rotated array
- Search in rotated array GFG
- Ternary Search GFG
- Double Helix SPOJ
- Factorial Number GFG
- String
- Bit Manipulation
- Basic Concepts
- Power of 2 GFG
- Power Set GFG
- Rightmost Different Bit GFG
- Subset
- Bit Difference GFG
- Bleak Number GFG
- Count Set Bits GFG
- Grey Code GFG
- Minimum XOR Pairs GFG
- Calculate square of a number without using *, / and pow() GFG
- Reverse Bits GFG
- Is Binary Number Multiple of 3 GFG
- UTF-8 GFG
- Sum of XOR of all pairs GFG
- Same no of set bits as that of n GFG
- Reduce a Number to 1 in Minimum Steps GFG
- Power Set GFG
- Find the n-th number whose binary representation is a palindrome GFG
- Find Missing And Repeating GFG
- Copy Set Bits GFG
- Divide two integers LeetCode
- Print Abbravations
- Swap all odd and even bits GFG
- Nqueen
- Solve Soduku GFG
- Recursion
- Basic
- FloodFill
- CoinMax
- Permutations
- Coin Toss
- Climbing Stairs
- Generate Parentheses LeetCode
- Letter Combination Of Phone Numer LeetCode
- Palindrome Partitioning LeetCode
- Reverse String
- Palindrome Check
- Subsequence of a String
- Tower Of Hanoi GFG
- Path In Maze
- Josephus problem GFG
- Handshakes GFG
- Happy Number GFG
- Print N-bit binary numbers having more 1s than 0s GFG
- BackTracking
- Maze Block GFG
- Partition An Array
- Shortest Path In Maze
- Subset LeetCode
- Word Search LeetCode
- Black and White GFG
- Combination Sum GFG
- Partition array to K subsets (Print all subsets)
- Rat Maze with Multiple Jumps GFG
- Solve Soduku GFG
- Largest Number in K Swaps GFG
- N Queen Problem GFG
- K Length Words GFG
- Knights Tour GFG
- Kth Permutation GFG
- Remove Inavlid Parentheses LeetCode
- Word Break GFG
- Word Pattern GFG
- Tug Of War GFG
- Permutations (Two Methods) PepCoding
- Combinations (Two Methods) PepCoding
- Queen Permutation PepCoding
- Queen Combination PepCoding
- K Length Words PepCoding
- CrossWord Puzzle PepCoding
- N Queen Branch and Bound PepCoding
-
Mathematice For CP
-
Dynamic Programming
- Fibonacci-dp GFG
- Climb Stairs GFG
- Climb Stairs With Variable Jumps GFG
- Climb Stairs With Minimum Moves GFG
- Min cost In Maze Traversal GFG
- Goldmine GFG
- Target Sum Subsets - DP GFG
- Coin Change Combinations GFG
- Coin Change Permutations GFG
- Zero One Knapsack GFG
- Unbounded Knapsack GFG
- Count Binary Strings GFG
- Arrange Buildings GFG
- Count Encodings GFG
- Count A+B+C subsequences GFG
- Maximum Sum Non Adjacent Elements GFG
- Paint House GFG
- Paint House-Many colors GFG
- Paint Fence GFG
- Tiling with 2*1 Tiles GFG
- Tiling with M*1 Tiles GFG
- Friends Pairing GFG
- Partition Into Subsets GFG
- Buy & Sell Stock - Cooldown GFG
- Buy and Sell Stocks- Two Transactions Allowed GFG
- Buy and Sell Stocks- K Transactions Allowed GFG
- Longest increasing subsequence GFG
- Max Non Overlapping Bridges GFG
- Catalan Numbers GFG
- Number Of Bsts Medium GFG
- Count Of Valleys And Mountains Easy GFG
- Count Brackets Easy GFG
- Circle And Chords Easy GFG
- Number Of Ways Of Triangulation Easy GFG
- Catalan Numbers Variation GFG
- Count Palindromic substring GFG
- Longest Palindromic substring GFG
- 2 keys keyboard GFG
- Min Squares GFG
- Longest Common Subsequence GFG
- Longest Palindromic Subsequences GFG
- Count Palindromic subsequences GFG
- Count Distinct Subsequences GFG
- Count Distinct Palindromic Subsequences GFG
- Wildcard Pattern Matching GFG
- Regular Expression Matching GFG
- Min Score of triangulation GFG
- Rod Cutting GFG
- Min Palindrome Cut GFG
- Matrix Chain Multiplication GFG
- Boolean Parenthesization GFG
- Optimal Binary Search Tree GFG
- Burst Balloons GFG
- Longest Common Substring GFG
- Longest Repeating Subsequence GFG
- Minimum Ascii Delete Sum For Two Strings GFG
- Shortest uncommon subsequence GFG
- Distinct Transformations GFG
- Probability Of Knight In The Chessboard Medium GFG
- Edit Distance GFG
- Kadane's Algorithm GFG
- K Concatenation GFG
- Maximum Sum Subarray With At Least K Elements GFG
- Numeric Keypad GFG
- Maximum Difference Of Zeros And Ones In Binary String GFG
- Maximum Sum Of Two Non-overlapping Subarrays GFG
- Optimal Strategy For A Game GFG
- Maximum Sum Of Three Non-overlapping Subarrays GFG
- Maximum Sum Of M Non-overlapping Subarrays GFG
- Floor Tiling GFG
- Cherry Pickup GFG
- Arithmetic Slices 1 GFG
- Arithmetic Slices 2 GFG
- Largest Square Sub-matrix With All 1's GFG
- Word Break GFG
- Ugly Number GFG
- Super Ugly Number GFG
- Find Water In Glass GFG
- Frog Jump GFG
-
ArrayList
-
LinkedList
- Reverse a LL GFG
- Rearrange LL in place GFG
- Sorted insert for LL GFG
- Sorted insert for CLL GFG
- Sorted insert for DLL GFG
- Absolute List Sorting GFG
- Detect loop GFG
- Remove loop GFG
- Intersection point in Y shaped LL GFG
- Reverse a LL in groups of size K GFG
- Count Triplets GFG
- Intersection of two sorted LL GFG
- Union of two LL GFG
- Add 1 Number in LinkedList GFG
- Add Two LinkedList GFG
- Split a circular LiinkedList into two halves GFG
- Mutliply two LinkedList GFG
- Multiply two LinkedList 2 GFG
- Quick Sort on LinkedList GFG
- Quick Sort on DoublyLinkedList GFG
- Merge Sort on LinkedList GFG
- Flatten a LinkedList GFG
- Remove Duplicates from an unsorted LinkedList GFG
- LinkedList is Palindrome GFG
- Pairs with Given Sum in DoublyLinkedList GFG
- Sort a LinkedList containing 0's, 1's and 2's GFG
- Clone a LinkedList GFG
- Merge k sorted LL GFG
- Design LRU Cache GFG
- Reverse In Range LeetCode
-
Vector & Stacks
- Parenthesis Checker GFG
- Celebrity Problem GFG
- Restrictive Candy Crush GFG
- Stack using two Queues GFG
- Valid Substring GFG
- Maximum Rectangular Area in a Histogram GFG
- Infix Evaluation GFG
- Infix Conversion GFG
- Postfix Evaluation GFG
- Postfix Conversion
- Prefix Conversion
- Patten Following GFG
- Next greator Element GFG
- Implemennt K stacks GFG
- Score of Parentheses LeetCode
- Min Remove to make parestheses valid LeetCode
- Asteroid Collission LeetCode
- Remove Duplicate letters LeetCode
- Online Stock Span LeetCode
- Exclusive time of finctions LeetCode
- 132 pattern LeetCode
- Remove K digits LeetCode
- Basic Calculator LeetCode
- Next Gretor Element II LeetCode
-
Queue
- Restricted Pacman GFG
- Sliding Window Maximum (Max of all subarrays of size k) GFG
- First negative integer in every window os size k GFG
- Card Rotation GFG
- Interleave the first half of the queue with second half GFG
- Queue using Stacks GFG
- Stack using Queue (Push Efficient) GFG
- Stack using Queue (Pop Efficient) GFG
-
HashMap
- Map Implementation PepCoding
- Array Pair Sum Divisibility GFG
- Count Distinct element in every window of size k GFG
- Find Number of Employees under every employee GFG
- Find Itinerary from a given list of tickets GFG
- Largest Subarray with sum k GFG
- Largest Subarray with sum 0 GFG
- Count total no of subarrays with sum k LeetCode
- Count total no of subarrays with sum zero GFG
- Largest Subarray with contigous elements GFG
- Smallest window in string containing all the characters GFG
- Smallest window that contains all characters of string itself GFG
- Length of the longest substring having all unique characters GFG
- Count of substring having all unique characters GFG
- Longest substring with exactly k unique characters GFG
- Count of Equivalent Subarrays GFG
- Maximum Consecutive Ones LeetCode
- Longest Substring With At Most K Unique Characters PepCoding
- Count of Substring With At Most K Unique Characters PepCoding
- K Anagrams GFG
- Group Shifted Strings GFG
- Isomorphic Strings GFG
- Word Pattern LeetCode
- Longest Subarray with equal no of 0's and 1's GFG
- Count of Subarray with equal no of 0's and 1's Pepcoding
- Longest Subarray With Sum Divisible By K GFG
- Count of Subarray With Sum Divisible By K GFG
- Longest Subarray With Equal Number Of 0s 1s And 2s PepCCoding
- Count of Subarray With Equal Number Of 0s 1s And 2s GFG
- Pairs with Equal sum PepCoding
- Simple Fraction GFG
- Rabbits in the Forest LeetCode
- Arithmetic Sequence LeetCode
- Smallest Subarray With All Occurrences Of The Most Frequent Element GFG
- Double Pair Array LeetCode
- Maximum Points on the line LeetCode
- Quadruplet Sum 1 LeetCode
- Quadruplet Sum 2 LeetCode
- Frequency Game
- Group Anagrams GFG
- Ruling Pair GFG
- Sort and array according to other GFG
-
Heap
-
Trees
- Generic Tree
- Implementation
- Level Order Traversal PepCoding
- Level Order Traversal (Line by Line) PepCoding
- Level Order Traversal (Zig Zag) PepCoding
- Remove Leaves PepCoding
- Linearize Tree PepCoding
- Linearize Tree in O(n) PepCoding
- Node to Root Path PepCoding
- Lowest Common Ancestor PepCoding
- Multisolver PepCoding
- Predecessor and Successor PepCoding
- Ceil And Floor PepCoding
- Kth Largest Element PepCoding
- Node with Max Subtree Sum PepCoding
- Diameter PepCoding
- Iterative Preorder And Postorder PepCoding
- Binary Tree
- Implementation
- Level Order Traversal (Line by Line) LeetCode
- Level Order Traversal (Spiral Form) GFG
- Nodes at given distance from root GFG
- Node to Root Path GFG
- Node k distance away Two Methods GFG
- Diameter Of Binary Tree GFG
- Tree is BST or not GFG
- Balanced Tree GFG
- Largest BST Subtree GFG
- Min No of Camera LeetCode
- House Robbery GFG
- Longest ZigZag path LeetCode
- Validate BST Using Inorder GFG
- Fix two Node of BST GFG
- Left View GFG
- Right View GFG
- Top View GFG
- Bottom View GFG
- Vertical Order Traversal LeetCode
- Vertical Order Traversal (M-2) LeetCode
- Diagonal Traversal GFG
- Vertical Order Traversal With a constraint PepCoding
- Searialize and Deserialize LeetCode
- Diagonal Order Sum using dfs GFG
- Inorder Morris Traversal GFG
- Preorder Morris Traversal GFG
- Lowest Common Ancestor LeetCode
- Max Path Sum between two Leaves GFG
- Max Path Sum between two Node GFG
- Construct BT Using Inorder and Preorder GFG
- Construct BT Using Inorder and Postorder GFG
- Construct BT Using Preorder and Postorder GFG
- Construct BT Using Inorder and Levelorder GFG
- Validate BST Using Morris Traversal GFG
- Make BT Fron LL GFG
- Print BT levels in Sorted Order GFG
- Check Tree Traversal GFG
- Corona Vaccine GFG
- Inorder, Preorder and Postorder Using Iterative Approach
- Burning Tree 1 GFG
- Burning Tree 2 GFG
- Max Width of Binary Tree GFG
- Symmetric Tree GFG
- Valentine Sum GFG
- Binary Search Tree
- Implementation
- Level Order Traversal GFG
- Array to BST GFG
- Construct BST from Preorder GFG
- Construct BST from Postorder GFG
- Construct BST from Level Order GFG
- Convert BST to Doubly LL PepCoding
- Convert sorted Doubly LL to BST PepCoding
- Binary Search Iterator (Stack) GFG
- Binary Search Iterator (Morris) GFG
- Generic Tree
-
Graph
- Implement GFG
- bfs GFG
- dfs GFG
- Connected Components GFG
- No of Islands GFG
- Hamiltonian Path GFG
- Detect Cycle Undirected using bfs and dfs GFG
- Detect Cycle Directed using dfs GFG
- Bipartite Graph using bfs and dfs GFG
- Topological Sort using dfs GFG
- Topological Sort using bfs kahn's Algo GFG
- Graph Cyclic Directed using bfs (Kahn's Algo) GFG
- Shortest path in directed acyclic graph GFG
- Dijkstra's Algo GFG
- Prims Algo GFG
- Disjoint Sets GFG
- Detect Cycle using Disjoint Sets GFG
- Kruskals Algo GFG
- DFS vs DSU GFG
- Bellman Ford Algo (Detect Negative Weight Cycle) GFG
- Coloring a Border GFG
- Number Of Distinct Island Medium GFG
- 01 Matrix GFG
- Rotten Oranges GFG
- Bus Routes GFG
- Sliding Puzzle GFG
- Min swaps to sort an array GFG
- Minimum edges to reverse to make path from a source to a destination GFG
- Alien Dictionary GFG
- Optimize Water Distribution GFG
- Swim in rising water GFG
- Kosaraju Algo GFG
- Mother Vertex GFG
- Articulation point GFG
- Bridges in graph GFG
- Remove Max Number of Edges to Keep Graph Fully Traversable GFG
- No of islands 2 GFG
- Regions cut by slashes GFG
- Eulerian Path and circuit GFG
- Reconstruct Itinerary GFG
- Redundant Connection 1 and 2(Imp) GFG
- Satisfiability Of Equality Equation GFG
- Sentence Similarity GFG