Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/naren-jha/algorithms

Repo to host code for learning Data Structures and Algorithms
https://github.com/naren-jha/algorithms

algorithm data-structures dynamic-programming graph-theory

Last synced: 10 days ago
JSON representation

Repo to host code for learning Data Structures and Algorithms

Awesome Lists containing this project

README

        

# [:books:](https://drive.google.com/drive/folders/0B1EMPyM0E8hzR093NjEyYm8zdjA?usp=sharing)Data Structures and Algorithms
Implementation of most common data structures and algorithms in Java.

## Data Structures
* [:blue_book:](https://drive.google.com/file/d/1sa70Y2C6XUWq9g77dQtWuLKSr7ZirnCV/view?usp=sharing) [Linked Lists](https://github.com/njha-collab/Algorithms/blob/master/src/basic/ll/)
- [Singly Linked Lists](https://github.com/njha-collab/Algorithms/tree/master/src/basic/ll/singly)
- [Doubly Linked Lists](https://github.com/njha-collab/Algorithms/blob/master/src/basic/ll/doubly)
* [:blue_book:](https://drive.google.com/file/d/18R7ab5qwcv9LBBVXZJfOCOz6_xPSsQtf/view?usp=sharing) [Stack](https://github.com/njha-collab/Algorithms/blob/master/src/basic/stack/)
- [Using Array](https://github.com/njha-collab/Algorithms/blob/master/src/basic/stack/usingarray/StackTest.java)
- [Using Linked List](https://github.com/njha-collab/Algorithms/blob/master/src/basic/stack/using_linkedlist/StackTest.java)
- [Using Queue](https://github.com/njha-collab/Algorithms/tree/master/src/basic/queue/problems)
* [:blue_book:](https://drive.google.com/file/d/1CFI6GsKqkH_mb32Tc6d3hpLQo3yS0MyQ/view?usp=sharing) [Queue](https://github.com/njha-collab/Algorithms/tree/master/src/basic/queue/)
- [Using Array](https://github.com/njha-collab/Algorithms/blob/master/src/basic/queue/usingarray/QueueTest.java)
- [Using Linked List](https://github.com/njha-collab/Algorithms/blob/master/src/basic/queue/using_linkedlist/QueueTest.java)
- [Using Stack](https://github.com/njha-collab/Algorithms/tree/master/src/basic/queue/problems)
* [:blue_book:](https://drive.google.com/file/d/1CFI6GsKqkH_mb32Tc6d3hpLQo3yS0MyQ/view?usp=sharing) [Deque](https://github.com/njha-collab/Algorithms/blob/master/src/basic/queue/)
- [Using Array](https://github.com/njha-collab/Algorithms/blob/master/src/basic/queue/usingarray/DequeTest.java)
- [Using Linked List](https://github.com/njha-collab/Algorithms/blob/master/src/basic/queue/using_linkedlist/DequeTest.java)
* [:blue_book:](https://drive.google.com/file/d/1E2o4U1md4EK9O9Klv3BsP5bfyXYUS-2h/view?usp=sharing) [Binary Search Tree](https://github.com/njha-collab/Algorithms/blob/master/src/tree/bst/BstTest.java)
* [:blue_book:](https://drive.google.com/file/d/1XQdrirRTAh_3FGP-bjyYGkY7zjA0C01S/view?usp=sharing) [Hashtable](https://github.com/njha-collab/Algorithms/blob/master/src/basic/hashing/)
- [Chaining](https://github.com/njha-collab/Algorithms/blob/master/src/basic/hashing/chaining/HashTableTest.java)
- [Open Addressing](https://github.com/njha-collab/Algorithms/blob/master/src/basic/hashing/openaddressing/HashTableTest.java)
* [:blue_book:](https://drive.google.com/file/d/1pBnFDa2iOlUfo5lcVeiRdiVnZn2sc-pc/view?usp=sharing) [Union Find](https://github.com/njha-collab/Algorithms/blob/master/src/basic/unionfind)
- [Union Find - Merge By Rank](https://github.com/njha-collab/Algorithms/blob/master/src/basic/unionfind/UnionFindMergeByRank.java)
- [Union Find - Merge By Size](https://github.com/njha-collab/Algorithms/blob/master/src/basic/unionfind/UnionFind.java)
* [:blue_book:](https://drive.google.com/file/d/1E2o4U1md4EK9O9Klv3BsP5bfyXYUS-2h/view?usp=sharing) [Heap (Priority Queues)](https://github.com/njha-collab/Algorithms/blob/master/src/tree/heap/)
- [Max Heap](https://github.com/njha-collab/Algorithms/blob/master/src/tree/heap/MaxHeapTest.java)
- [Min Heap](https://github.com/njha-collab/Algorithms/blob/master/src/tree/heap/MinHeapTest.java)
* [:blue_book:](https://drive.google.com/drive/folders/19bfBzFUf6uRLMWV7LjPm_BO32odRUEs3?usp=sharing) [Self-Balancing BSTs](https://github.com/njha-collab/Algorithms/blob/master/src/advance_ds/)
- [:blue_book:](https://drive.google.com/file/d/1LrCbfVkvHhdCETeGw2EkoJNv5SlYJNH6/view?usp=sharing) [AVL Tree](https://github.com/njha-collab/Algorithms/blob/master/src/advance_ds/AVLTree.java)
- [:blue_book:](https://drive.google.com/file/d/1xSkXnlfFgmHMleDiMyWN9NzKFej-dur9/view?usp=sharing) [Red-Black Tree](https://github.com/njha-collab/Algorithms/blob/master/src/advance_ds/RedBlackTree.java)
* [:blue_book:](https://drive.google.com/file/d/1QUQCZLMmahpapweMxA1i3OsGVLvJuI95/view?usp=sharing) [Trie](https://github.com/njha-collab/Algorithms/tree/master/src/advance_ds/trie)
* [:blue_book:](https://drive.google.com/file/d/1To7EjATwT1EB4c2GjnYd_QWJFwLL_zMb/view?usp=sharing) [Segment Tree](https://github.com/njha-collab/Algorithms/blob/master/src/advance_ds/segment_tree/)
- [Range Minimum Query (RMQ)](https://github.com/njha-collab/Algorithms/blob/master/src/advance_ds/segment_tree/RangeMinimumQuery.java)
- [Range Sum Query](https://github.com/njha-collab/Algorithms/blob/master/src/advance_ds/segment_tree/RangeSumQuery.java)
- [RMQ - Lazy Propagation](https://github.com/njha-collab/Algorithms/blob/master/src/advance_ds/segment_tree/SegmentTreeRMQLazy.java)
* [:blue_book:](https://drive.google.com/file/d/1BVtkZjrGa0jFmn4PzGPli3331whmwXaw/view?usp=sharing) [Fenwick Tree](https://github.com/njha-collab/Algorithms/blob/master/src/advance_ds/BinaryIndexedTree.java)
* [:blue_book:](https://drive.google.com/file/d/1dBxCR6qKjK-6Cjs72M4-K2o-_v0TJMY7/view?usp=sharing) [LRU Cache](https://github.com/njha-collab/Algorithms/blob/master/src/advance_ds/lru_cache/LRUCache.java)

## Dynamic Programming [Problems]
[Sorted: Easy To Hard]
1. [Fibonacci Numbers](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/FibonacciNumbers.java)
2. [Ugly Numbers](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/UglyNumbers.java)
3. [Super Ugly Numbers](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/SuperUglyNumbers.java)
4. [Tiling 2Xn Floor With 2X1 Tile](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/Tiling2XnFloorWith2X1Tile.java)
5. [Tiling NxM Floor With 1xM Tile](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/TilingNxMFloorWith1xMTile.java)
6. [Gold Mine Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/GoldMineProblem.java)
7. [Max Path Sum](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MaxPathSum.java)
8. [**Coin Change Problem**](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/CoinChangeProblem.java):fire:
9. [Friends Pairing Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/FriendsPairingProblem.java)
10. [Subset Sum Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/SubsetSumProblem.java)
11. [**Perfect Sum Problem**](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/PerfectSumProblem.java):fire:
12. [Subset Sum Divisible By M](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/SubsetSumDivisibleByM.java)
13. [Change Making Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/ChangeMakingProblem.java)
14. [Rod Cutting Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/RodCuttingProblem.java)
15. [Tiling With Dominoes](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/TilingWithDominoes.java)
16. [Painting Fence Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/PaintingFenceProblem.java)
17. [Assembly Line Scheduling](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/AssemblyLineScheduling.java)
18. [Maximum Length Snake Sequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MaximumLengthSnakeSequence.java)
19. [Even Length Binary Sequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/EvenLengthBinarySequence.java)
20. [Sequences Of Given Length](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/SequencesOfGivenLength.java)
21. [**Longest Common Subsequence**](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/LongestCommonSubsequence.java):fire:
22. [Longest Repeated Subsequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/LongestRepeatedSubsequence.java)
23. [LCS of 3 Strings](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/LcsOf3Strings.java)
24. [**Longest Increasing Subsequence**](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/LongestIncreasingSubsequence.java):fire:
25. [Longest Bitonic Subsequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/LongestBitonicSubsequence.java)
26. [Maximum Sum Increasing Subsequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MaximumSumIncreasingSubsequence.java)
27. [Maximum Sum Bitonic Subsequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MaximumSumBitonicSubsequence.java)
28. [Maximum Product Increasing Subsequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MaximumProductIncreasingSubsequence.java)
29. [Product Subsequences Count](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/ProductSubsequencesCount.java)
30. [Maximum Sum No Two Adjacent](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MaximumSumNoTwoAdjacent.java)
31. [Maximum Sum No Three Adjacent](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MaximumSumNoThreeAdjacent.java)
32. [Longest Subseq Adjacent Diff1](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/LongestSubseqAdjacentDiff1.java)
33. [Max Length Chain Pairs](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MaxLengthChainPairs.java)
34. [Path With Maximum Average Value](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/PathWithMaximumAverageValue.java)
35. [Min Cost Path](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MinCostPath.java)
36. [Max Path Sum Triangle](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MaxPathSumTriangle.java)
37. [Min Path Sum Triangle](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MinPathSumTriangle.java)
38. [**Maximum Sum Subarray - Kadane’s Algorithm**](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MaximumSumSubarray.java):fire:
39. [Maximum Size Square Sub Matrix](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MaximumSizeSquareSubMatrix.java)
40. [Max Sum 2x1 Grid](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MaxSum2x1Grid.java)
41. [Max Path Sum With Jumps Under Div](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MaxPathSumWithJumpsUnderDiv.java)
42. [Min Jumps To Reach End](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/MinJumpsToReachEnd.java)
43. [Edit Distance](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/EditDistance.java)
44. [**Longest Common Substring**](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/LongestCommonSubstring.java):fire:
45. [Sum Of All Substrings](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/SumOfAllSubstrings.java)
46. [Count Ways To Build Street](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/WaysToBuildStreet.java)
47. [Cover Distance](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/CoverDistance.java)
48. [Diff Ways To Sum](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/DiffWaysToSum.java)
49. [**0-1 Knapsack**](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/Knapsack.java):fire:
50. [Temple Offering Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/TempleOffering.java)
51. [Egg Dropping Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/EggDropping.java)
52. [Dice Throw Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/DiceThrowProblem.java)
53. [**Word Break Problem**](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/WordBreakProblem.java):fire:
54. [Box Stacking Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/BoxStackingProblem.java)
55. [Longest Palindromic Subsequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/LongestPalindromicSubsequence.java)
56. [Count All Palindromic Subsequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/CountAllPalindromicSubsequence.java)
57. [Longest Palindromic Substring](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/LongestPalindromicSubstring.java)
58. [Count All Palindrome SubStrings](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/CountAllPalindromeSubStrings.java)
59. [Shortest Common Supersequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/ShortestCommonSupersequence.java)
60. [Longest ZigZag or Alternating Subsequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/LongestZigZagSubsequence.java)
61. [Maximum Sum ZigZag or Alternating Subsequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MaximumSumZigZagSubsequence.java)
62. [Minimum Number of Coins To Make a Change](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MinCoinsToMakeChange.java)
63. [Possible Ways To Construct Buildings](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/PossibleWaysToConstructBuildings.java)
64. [Number Different Ways To Reach End](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/DifferentWaysToReachEnd.java)
65. [Count Number of Binary Strings Without Consecutive 1s](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/CountBinaryStringsWithoutConsecutive1.java)
66. [Count Number of Paths With At Most k Turns](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/CountPathsWithUpperLimitOnTurns.java)
67. [Count Possible Decodings of Digit Sequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/CountDecodingsDigitSequence.java)
68. [Number of Ways To Partition A Set Into k Subsets](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/PartitionSetIntoKsubsets.java)
69. [Count n Digit Numbers With Given Digit Sum](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/CountNumbersWithGivenSum.java)
70. [Count Strings Formed Using a b c](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/CountStringWithABC.java)
71. [Count Numbers With Even Odd Digit Sum Difference of 1](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/CountNumsWithEvenOddSumDiff1.java)
72. [Maximum Profit From Sale of Wines](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MaxProfitWineSale.java)
73. [Maximum Size Subset Sum](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MaxSizeSubsetSum.java)
74. [Maximum Sum Subarray Removing At Most One Element](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MaximumSumSubarrayRemovingAtMostOneElement.java)
75. [K maximum sums of non-overlapping contiguous sub-arrays](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/KmaximumSumsNonOverlappingContiguousSubArrays.java)
76. [Maximum Product Subarray](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MaximumProductSubarray.java)
77. [Maximum Dot Product of Two Arrays](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MaximumDotProductTwoArrays.java)
78. [**Minimum Initial Points to Reach Destination (Dungeon Game)**](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MinimumInitialPointsToReachDestination.java):fire:
79. [Minimum Insertions To Form Palindrome](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MinimumInsertionsToFormPalindrome.java)
80. [Minimum Number of Squares Sum to Given Number](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/SquareSumToNumber.java)
81. [Remove Minimum Elements From Either Side](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/RemoveMinElementsFromEitherSide.java)
82. [Minimum Cells Required To Reach Destination](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MinCellsRequiredToReachDestination.java)
83. [Longest Increasing Circular Subsequence](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/LongestIncreasingCircularSubsequence.java)
84. [Longest Path In A Matrix With Given Constraints](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/LongestPathInMatrixFourDirections.java)
85. [Count Distinct Subsequences](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/DistinctSubsequences.java)
86. [Longest Consecutive Path In Matrix](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/LongestConsecutivePathInMatrix.java)
87. [Length of longest subsequence of one string which is substring of another string](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/LCSubSeqSubStr.java)
88. [Wildcard Pattern Matching](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/WildcardPatternMatching.java)
89. [Optimal Strategy For Game](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/OptimalStrategyForGame.java)
90. [Number of Permutations With K Inversions](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/NumberOfPermutationsWithKInversions.java)
91. [Largest Divisible Pairs Subset](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/LargestDivisiblePairsSubset.java)
92. [Sum Of Digits In Numbers From 1 To N](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/SumOfDigitsFrom1ToN.java)
93. [Number of Non Decreasing Numbers](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/NumberOfNonDecreasingNumbers.java)
94. [Catalan Number](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/CatalanNumber.java) [:blue_book:](https://drive.google.com/file/d/1iJAoakEGHhNeFhBJ8ncW-PlO8jh0veuI/view?usp=sharing)
95. [Non-crossing lines to connect points in a circle](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/NonCrossingHandShakes.java)
96. [Building Bridges](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/BuildingBridges.java)
97. [Longest Substring Without Repeating Characters](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/LongestSustringWithoutRepeatingCharacters.java)
98. [Longest Even Length Substring such that Sum of First and Second Half is same](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/LongestEvenLengthSubstr.java)
99. [Partition Set To Subset Sum Minimum Diff](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/PartitionSetToSubsetSumMinimumDiff.java)
100. [**Matrix Chain Multiplication**](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/MatrixChainMultiplication.java):fire:
101. [Minimum and Maximum values of an expression](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MinAndMaxValueOfExpr.java)
102. [Optimal Binary Search Tree](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/OptimalBinarySearchTree.java)
103. [Regular Expression Matching](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/RegularExpressionMatching.java)
104. [Text Justification](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/TextJustification.java)
105. [Palindrome Partitioning](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/PalindromePartitioning.java)
106. [Mobile Numeric Keypad Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/MobileNumericKeypadProblem.java)
107. [The Painters Partition Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/PaintersPartitionProblem.java)
108. [Boolean Parenthesization Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/BooleanParenthesizationProblem.java)
109. [Number of Palindromic Paths In A Matrix](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/CountPalindromicPathsInMatrix.java)
110. [Maximum Sum Rectangle In a 2D Matrix](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/MaximumSumRectangleInMatrix.java)
111. [Largest Rectangular SubMatrix With Zero Sum](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/LargestRectangularSubMatrixZeroSum.java)
112. [Largest Rectangular SubMatrix With Equal Number of 1s and 0s](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/LargestRectangularSubMatrixWithEqual1sAnd0s.java)
113. [Print Maximum Number of A's Using 4 Keys](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/PrintMaximumNumberOfAs.java)
114. [Maximum Profit By Buying And Selling A Share At Most Twice](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MaximumProfitByBuyingAndSellingShareAtMostTwice.java)
115. [Maximum Profit By Buying And Selling A Share At Most K Times](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/MaximumProfitByBuyingAndSellingShareAtMostKtimes.java)
116. [Maximum Size Rectangle Of All 1s](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MaximumSizeRectangleOfAll1s.java)
117. [Count Number of BSTs - Catalan Number](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/CountNumberOfBSTs.java)
118. [Maximize Expression A[j] - A[i] + A[l] - A[k]](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/MaximizeExpression.java)
119. [Minimum Cost Polygon Triangulation](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/MinimumCostPolygonTriangulation.java)
120. [Minimum Possible Size of Array With Given Rules For Removing Elements](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/MinPossibleSizeOfArray.java)
121. [Longest Arithmetic Progression](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/LongestArithmeticProgression.java)
122. [Probability of Knight to Remain In The Chessboard](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/ProbabilityOfKnightToRemainInChessboard.java)
123. [Number of Subsequences of The Form a^i b^j c^k](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/NumberOfSubsequences.java)
124. [Check If All People Can Vote On Two Machines](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/CheckIfAllPeopleCanVoteOn2Machines.java)
125. [Number of Subsequences In A String Divisible By N](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/NumberOfSubsequencesDivisibleByN.java)
126. [Highway Billboard Problem](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/HighwayBillboardProblem.java)
127. [Longest Subseq Adjacent Diff01](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/basic/LongestSubseqAdjacentDiff01.java)
128. [Maximum Weight Transformation of A Given String](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/MaximumWeightTransformationOfString.java)
129. [String Interleaved of Two Other String](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/StringInterleavedOfTwoOtherString.java)
130. [Weighted Job Scheduling](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/WeightedJobScheduling.java)
131. [Burst Balloon [Leetcode #312]](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/BurstBalloons.java)
132. [Range Sum Query 2D - Immutable [Leetcode #304]](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/ImmutableRangeSumQuery2D.java)
133. [Maximum Subsquare With Sides As X](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MaximumSubsquareWithSidesAsX.java)
134. [Maximize Binary Matrix By Filpping Submatrix Once](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/MaximizeBinaryMatrixByFilppingSubmatrixOnce.java)
135. [Ways To Arrange Balls Such That Adjacent Balls Are of Different Types](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/WaysToArrangeBalls.java)
136. [Ways of Transforming One String To Another By Removing Characters](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/intermediate/WaysOfTransformingOneStringToAnother.java)
137. [Maximum Subarray Sum Excluding Certain Elements](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/MaxSubarraySumExcludingCertainElements.java)
138. [Maximum Points From Top Left To Bottom Right And Return Back](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/MaximumPoints.java)
139. [Longest Geometric Progression](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/LongestGeometricProgression.java)
140. [Count AP (Arithmetic Progression) Subsequences In An Array](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/CountAPSubsequences.java)
141. [All Ways To Add Parenthesis For Evaluation](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/AllWaysToAddParenthesisForEvaluation.java)
142. [Minimum Cost To Sort Strings Using Reversals](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/MinimumCostToSortStringsUsingReversal.java)
143. [Largest Minimum Sum Split Subarray](https://github.com/njha-collab/Algorithms/blob/master/src/dynamicprogramming/hard/LargestMinimumSumSplitSubarray.java)

## [:blue_book:](https://drive.google.com/drive/folders/1tfkGKv_wtKX7ui36fkjfpe5XGUqlc8rc?usp=sharing) Sorting Algorithms
* [Merge Sort](https://github.com/njha-collab/Algorithms/blob/master/src/sorting/MergeSort.java) **- O(nlgn)**
* [QuickSort](https://github.com/njha-collab/Algorithms/blob/master/src/sorting/QuickSort.java) **- Θ(nlgn)**
* [Heap Sort](https://github.com/njha-collab/Algorithms/blob/master/src/sorting/HeapSort.java) **- O(nlgn)**
* [Tim Sort](https://drive.google.com/file/d/1dGkNfCcXM5K8s1-mKowcUjyvsxMbQtxZ/view?usp=sharing) :blue_book: **- O(nlgn)**
* [Bubble Sort](https://github.com/njha-collab/Algorithms/blob/master/src/sorting/BubbleSort.java) **- O(n2)**
* [Insertion Sort](https://github.com/njha-collab/Algorithms/blob/master/src/sorting/InsertionSort.java) **- O(n2)**
* [Shell Sort](https://github.com/njha-collab/Algorithms/blob/master/src/sorting/Shell.java) **- O(n2)**
* [Counting Sort](https://github.com/njha-collab/Algorithms/blob/master/src/sorting/CountingSort.java) **- O(n + k)**
* [Bucket Sort](https://github.com/njha-collab/Algorithms/blob/master/src/sorting/BucketSort.java) **- Θ(n + k)**
* [Radix Sort](https://github.com/njha-collab/Algorithms/blob/master/src/sorting/RadixSort.java) **- O(d\*n)**

## [:blue_book:](https://drive.google.com/file/d/1VghYyVfJsGJsDrHWp8hv_RfNoXjw7w53/view?usp=sharing) Graph Theory
* [Adjacency List Representation](https://github.com/njha-collab/Algorithms/blob/master/src/graph/Graph.java), [Adjacency List Representation 2](https://github.com/njha-collab/Algorithms/blob/master/src/graph/GraphUsingArrayOfArray.java)
* [BFS](https://github.com/njha-collab/Algorithms/blob/master/src/graph/BreadthFirstSearch.java) **- O(V+E)**
- [Shortest Path In Unweighted Graph](https://github.com/njha-collab/Algorithms/blob/master/src/graph/ShortestPathUnweightedGraph.java) **- O(V+E)**
- [Shortest Path On A Grid](https://github.com/njha-collab/Algorithms/blob/master/src/graph/ShortestPathOnAGrid.java) **- O(V+E)**
* [DFS](https://github.com/njha-collab/Algorithms/blob/master/src/graph/DepthFirstSearch.java) **- O(V+E)**
- [ConnectedComponents](https://github.com/njha-collab/Algorithms/blob/master/src/graph/ConnectedComponents.java) **- O(V+E)**
- [TransitiveClosure](https://github.com/njha-collab/Algorithms/blob/master/src/graph/TransitiveClosure.java) **- O(V+E)**
* [Topological Sorting](https://github.com/njha-collab/Algorithms/blob/master/src/graph/TopologicalSorting.java) **- O(V+E)**
* Cycle Detection
- [In Directed Graph - Using DFS](https://github.com/njha-collab/Algorithms/blob/master/src/graph/CycleInDirectedGraph.java) **- O(V+E)**
- [In Undirected Graph - Using DFS](https://github.com/njha-collab/Algorithms/blob/master/src/graph/CycleInUndirectedGraph.java) **- O(V+E)**
- [In Undirected Graph - Using Union Find](https://github.com/njha-collab/Algorithms/blob/master/src/graph/FindCycleUnionFind.java) **- O(E)**
* [Connected Components - Using Union Find](https://github.com/njha-collab/Algorithms/blob/master/src/graph/NumberOfConnectedComponentsUnionFind.java) **- O(E)**
* Single-Source Shortest Paths Algorithms
- [The Bellman-Ford Algorithm](https://github.com/njha-collab/Algorithms/blob/master/src/graph/BellmanFord.java) **- O(VE)**
- [Dijkstra's Algorithm](https://github.com/njha-collab/Algorithms/blob/master/src/graph/DijkstrasShortestPath.java) **- O((E+V)\*lgV)**
- [Shortest path in a DAG](https://github.com/njha-collab/Algorithms/blob/master/src/graph/ShortestPathInDAG.java) **- O(V+E)**
- [Longest path in a DAG](https://github.com/njha-collab/Algorithms/blob/master/src/graph/LongestPathInDAG.java) **- O(V+E)**
* [All-Pair Shortest Path: Floyd-Warshall Algorithm](https://github.com/njha-collab/Algorithms/blob/master/src/graph/FloydWarshallAPSP.java) **- O(V3)**
* [Bridges In Undirected Graph](https://github.com/njha-collab/Algorithms/blob/master/src/graph/Bridges.java) **- O(V+E)**
* [Articulation Points In Undirected Graph](https://github.com/njha-collab/Algorithms/blob/master/src/graph/ArticulationPoints.java) **- O(V+E)**
* Strongly Connected Components
- [Tarjan’s Algorithm](https://github.com/njha-collab/Algorithms/blob/master/src/graph/TarjansAlgorithmForSCC.java) **- O(V+E)**
- [Kosaraju’s Algorithm](https://github.com/njha-collab/Algorithms/blob/master/src/graph/KosarajusAlgorithmForSCC.java) **- O(V+E)**
* Travelling Salesman Problem
- [Brute-Force Approach](https://github.com/njha-collab/Algorithms/blob/master/src/graph/TspBruteForce.java) **- O(n!)**
- [DP Iterative Approach](https://github.com/njha-collab/Algorithms/blob/master/src/graph/TspDynamicProgrammingIterative.java) **- O(n22n)**
- [DP Recursive Approach](https://github.com/njha-collab/Algorithms/blob/master/src/graph/TspDynamicProgrammingRecursive.java) **- O(n22n)**
* [Eulerian Path (Directed Graph)](https://github.com/njha-collab/Algorithms/blob/master/src/graph/EulerianPathDirectedGraph.java) **- O(V+E)**
* Minimum Spanning Trees
- [Kruskal's Algorithm Using Union Find](https://github.com/njha-collab/Algorithms/blob/master/src/graph/KruskalsMST.java) **- O(ElgE)**
- [Kruskal's Algorithm Using Union Find - Lazy Sorting Using Priority Queue](https://github.com/njha-collab/Algorithms/blob/master/src/graph/KruskalsMstLazySortingUsingPriorityQueue.java) **- O(ElgE)**
- [Prim's Algorithm For MST](https://github.com/njha-collab/Algorithms/blob/master/src/graph/PrimsMst.java) **- O(ElgE)**

### Network Flow
* [Max flow, Min cut (Ford-Fulkerson using DFS, adjacency list)](https://github.com/njha-collab/Algorithms/blob/master/src/graph/networkflow/FordFulkersonDfsAdjacencyList.java) **- O(fE)**
* [Max flow, Min cut (Ford-Fulkerson using DFS, adjacency matrix)](https://github.com/njha-collab/Algorithms/blob/master/src/graph/networkflow/FordFulkersonDfsAdjacencyMatrix.java) **- O(fV2)**
* [Maximum Cardinality Bipartite Matching (Using Ford-Fulkerson DFS based Max Flow)](https://github.com/njha-collab/Algorithms/blob/master/src/graph/networkflow/MaximumCardinalityBipartiteMatchingMaxFlow.java) **- O(nE)**
* [[Problem]: Mice And Owls (Bipartite Matching)](https://github.com/njha-collab/Algorithms/blob/master/src/graph/networkflow/MiceAndOwls.java)
* [[Problem]: Elementry Math (Bipartite Matching)](https://github.com/njha-collab/Algorithms/blob/master/src/graph/networkflow/ElementryMath.java)
* [Bipartite graph verification (adjacency list, DFS)](https://github.com/njha-collab/Algorithms/blob/master/src/graph/networkflow/BipartiteGraphCheckAdjacencyList.java) **- O(V+E)**
* [Max flow, Min cut (Edmonds-Karp, adjacency list)](https://github.com/njha-collab/Algorithms/blob/master/src/graph/networkflow/EdmondsKarpAdjacencyList.java) **- O(VE2)**
* [Max flow, Min cut (Capacity scaling, adjacency list)](https://github.com/njha-collab/Algorithms/blob/master/src/graph/networkflow/CapacityScalingAdjacencyList.java) **- O(E2lgU)**
* [Max flow, Min cut (Dinic's, adjacency list)](https://github.com/njha-collab/Algorithms/blob/master/src/graph/networkflow/DinicsAdjacencyList.java) **- O(EV2), O(E√V) for bipartite graphs**