Some nice questions for beginners learning new stuffs (will be adding more in time)
Difference between en4 and en5, changed 449 character(s)
##_Although I'm too a beginner but I try to learn new things everyday, so here are the questions on DS which beginners like me find hard but are too easy if learned the DS nicely.
 ↵
# DS_ALGO_prep
_

## Arrays↵
| Index | Problem | Prerequisite |  ↵
| --- | --- | --- | ↵
| 1 | [Maximum circular subarray sum](https://practice.geeksforgeeks.org/problems/max-circular-subarray-sum/0) | Kadane's Algorithm |  ↵
| 2 | [Find subarray with given sum](https://practice.geeksforgeeks.org/problems/subarray-with-given-sum/0) | Hashing |  ↵
| 3 | [Equilibrium index of an array](https://practice.geeksforgeeks.org/problems/equilibrium-point/0) | None |↵
| 4 | [Maximum Sum Increasing Subsequence](https://practice.geeksforgeeks.org/problems/maximum-sum-increasing-subsequence/0) | Simple DP |↵
| 5 | [K-Concatenation](https://www.codechef.com/problems/KCON) | Kadane's Algorithm |↵
| 6 | [Convert array into Zig-Zag fashion](https://practice.geeksforgeeks.org/problems/convert-array-into-zig-zag-fashion/0) | None |↵
| 7 | [Find a pair with the given difference](https://practice.geeksforgeeks.org/problems/find-pair-given-difference/0) | Hashing |↵
| 8 | [Chocolate Distribution Problem](https://www.geeksforgeeks.org/chocolate-distribution-problem/) | None |↵
| 9 | [Minimum Number of Platforms Required for a Railway/Bus Station](https://practice.geeksforgeeks.org/problems/minimum-platforms/0) | None |↵
| 10 | [Trapping Rain Water](https://practice.geeksforgeeks.org/problems/trapping-rain-water/0) | None |↵
| 11 | [Stock Buy Sell to Maximize Profit](https://practice.geeksforgeeks.org/problems/stock-buy-and-sell/0) | None |↵
| 12 | [Rotate by 90 degree](https://practice.geeksforgeeks.org/problems/rotate-by-90-degree/0) | None |↵
| 13 | [Find k pairs with smallest sums in two arrays](https://www.geeksforgeeks.org/find-k-pairs-smallest-sums-two-arrays/) | None |↵
| 14 | [Search in a Rotated Array](https://practice.geeksforgeeks.org/problems/search-in-a-rotated-array/0) | None |↵
| 15 | [Given a sorted and rotated array, find if there is a pair with a given sum](https://www.geeksforgeeks.org/given-a-sorted-and-rotated-array-find-if-there-is-a-pair-with-a-given-sum/) | None |↵
| 16 | [Max sum in the configuration](https://practice.geeksforgeeks.org/problems/max-sum-in-the-configuration/1) | None |↵
| 17 | [Array of alternate +ve and -ve no.s](https://practice.geeksforgeeks.org/problems/array-of-alternate-ve-and-ve-nos1401/1) | Caution: When submitting the solution WA as they have not given clarity on how the array has to be change although the code changes the array as specified in the question |↵
| 18 | [Three way partitioning](https://practice.geeksforgeeks.org/problems/three-way-partitioning/1) |Dutch National Flag Quick Sort |↵
| 19 | [Sort an array of 0s, 1s and 2s ](https://practice.geeksforgeeks.org/problems/sort-an-array-of-0s-1s-and-2s/0) |Dutch National Flag Quick Sort |↵
| 20 | [Maximum length Bitonic Subarray](https://practice.geeksforgeeks.org/problems/maximum-length-bitonic-subarray5730/1) | In O(n) space |↵
| 21 | [Maximum length Bitonic Subarray](https://practice.geeksforgeeks.org/problems/maximum-length-bitonic-subarray5730/1) | In O(1) space |↵
| 22 | [Count Square Submatrices with All Ones](https://leetcode.com/problems/count-square-submatrices-with-all-ones/) | None |↵
## Stacks↵
| Index | Problem | Prerequisite |  ↵
| --- | --- | --- | ↵
| 1 | [Largest Rectangle in Histogram](https://leetcode.com/problems/largest-rectangle-in-histogram/) | None|↵
| 2 | [Stock Span Problem](https://practice.geeksforgeeks.org/problems/stock-span-problem/0) | None|↵
| 3 | [Reverse a Stack without using extra space](https://www.geeksforgeeks.org/reverse-a-stack-using-recursion/) |Recursion|↵
| 4 | [Delete middle element of stack](https://practice.geeksforgeeks.org/problems/delete-middle-element-of-a-stack/1) |Recursion|↵
| 5 | [Sort a Stack](https://practice.geeksforgeeks.org/problems/sort-a-stack/1#) |Recursion|↵
| 6 | [Sed Max](https://www.codechef.com/LTIME93B/problems/SEDMAX) |None|↵
| 7 | [Move Brackets](https://codeforces.com/problemset/problem/1374/C)|None|↵
| 8 | [Power Set](https://practice.geeksforgeeks.org/problems/power-set4302/1#)|Recursion|↵

## Segment Trees↵
| Index | Problem | Prerequisite |  ↵
| --- | --- | --- | ↵
| 1 | [Range Minimum Query](https://www.spoj.com/problems/RMQSQ/) | None|↵
| 2 | [Help Ashu](https://www.hackerearth.com/practice/data-structures/advanced-data-structures/fenwick-binary-indexed-trees/practice-problems/algorithm/help-ashu-1/) | None|↵

## Greedy Algos↵
| Index | Problem | Prerequisite |  ↵
| --- | --- | --- | ↵
| 1 | [Activity Selection](https://practice.geeksforgeeks.org/problems/n-meetings-in-one-room-1587115620/1) | Caution: Wrong test case on Geeks for Geeks|↵
| 2 | [Egyptian Factors](https://www.geeksforgeeks.org/greedy-algorithm-egyptian-fraction/) | Mathematics|↵
| 3 | [Job Sequencing Problem](https://practice.geeksforgeeks.org/problems/job-sequencing-problem-1587115620/1) |None|↵
| 4 | [Water Connection Problem](https://practice.geeksforgeeks.org/problems/water-connection-problem/0) |None|↵
| 5 | [Police Catch Thieves](https://www.geeksforgeeks.org/policemen-catch-thieves/) |None|↵

## DFS↵
| Index | Problem | Prerequisite |  ↵
| --- | --- | --- | ↵
| 1 | [Connected Components in a Graph](https://www.hackerearth.com/problem/algorithm/connected-components-in-a-graph/) |DFS on undirected graph|↵
| 2 | [Bishu and his Girlfriend](https://www.hackerearth.com/practice/algorithms/graphs/depth-first-search/practice-problems/algorithm/bishu-and-his-girlfriend/) | DFS on undirected graph|↵
| 3 | [Is it a tree](https://www.spoj.com/problems/PT07Y/) |Graph knowledge|↵
| 4 | [A Bug’s Life](https://www.spoj.com/problems/BUGLIFE/) |Bipartite graphs|↵
| 5 | [Fire Escape Routes](https://www.codechef.com/problems/FIRESC) |Connected Components|↵
| 6 | [Counting Rooms](https://cses.fi/problemset/task/1192/)|DFS on 2D grid|↵
| 7 | [Longest path in a tree](https://www.spoj.com/problems/PT07Z/)|Diameter of tree|↵
| 8 | [A Walk to Remember](https://www.hackerearth.com/practice/algorithms/graphs/strongly-connected-components/practice-problems/algorithm/a-walk-to-remember-qualifier2/) |Kosaraju's algo|↵
| 9 | [Maximum Size](https://www.codechef.com/problems/RISK) |DFS on 2D grid|↵
| 10| [Detect cycle in an undirected graph](https://practice.geeksforgeeks.org/problems/detect-cycle-in-an-undirected-graph/1) |DFS|↵
| 11| [Detect cycle in a directed graph](https://practice.geeksforgeeks.org/problems/detect-cycle-in-a-directed-graph/1#) |DFS|↵
| 12| [Tree House](https://www.codechef.com/MAY21C/problems/THOUSES) |DFS|↵
| 13| [Rat in maze Problem 1](https://practice.geeksforgeeks.org/problems/rat-in-a-maze-problem/1#) |DFS on 2D grid and Backtracking|↵
| 14| [Flood Fill](https://leetcode.com/problems/flood-fill/) |DFS on 2D grid|↵
| 15| [Number of Operations to Make Network Connected](https://leetcode.com/problems/number-of-operations-to-make-network-connected/)|Connected Components|↵

## BFS↵

| Index | Problem | Prerequisite |  ↵
| --- | --- | --- | ↵
| 1 | [Monk and the Islands](https://www.hackerearth.com/practice/algorithms/graphs/breadth-first-search/practice-problems/algorithm/monk-and-the-islands/) |BFS on undirected graph|↵
| 2 | [Prime Path](https://www.spoj.com/problems/PPATH/) | Sieve of Erosthenes and BFS|↵
| 3 | [Feasible relations](https://www.hackerearth.com/practice/algorithms/graphs/depth-first-search/practice-problems/algorithm/feasible-relations/) |BFS|↵
| 4 | [Social Networking Graph](https://www.hackerearth.com/practice/algorithms/graphs/breadth-first-search/practice-problems/algorithm/social-networking-graph/) |BFS|↵
| 5 | [Jungle Run](https://www.hackerearth.com/practice/algorithms/graphs/depth-first-search/practice-problems/algorithm/jungle-run/) |BFS on 2D grid|↵
| 6 | [Chess knight move](https://www.codechef.com/problems/PRGCUP01)|BFS on 2D grid|↵
| 7 | [Bitmap](https://www.spoj.com/problems/BITMAP/)|BFS on 2D grid|↵
| 8 | [Lucius Dungeon](https://www.spoj.com/problems/BYTESE1/)|BFS on 2D grid|↵
| 9 | [The Cats and the Mouse](https://www.spoj.com/problems/CATM/)|BFS on 2D grid|↵
| 10| [Word Ladder](https://leetcode.com/problems/word-ladder/) |BFS|↵
| 11| [Jump Game VII](https://leetcode.com/contest/weekly-contest-242/problems/jump-game-vii/) |BFS|↵

## Disjoint Set↵
| Index | Problem | Prerequisite |  ↵
| --- | --- | --- |↵
| 1 | [Teacher's Dilemma](https://www.hackerearth.com/problem/algorithm/teachers-dilemma-3-00955296/)|None|↵


## Bit Manipulation↵
| Index | Problem | Prerequisite |  ↵
| --- | --- | --- |↵
| 1 | [Number of 1 Bits ](https://practice.geeksforgeeks.org/problems/set-bits0143/1)|None|↵
| 2 | [Non Repeating Numbers ](https://practice.geeksforgeeks.org/problems/finding-the-numbers0215/1)|None|↵
| 3 | [Bit Difference](https://practice.geeksforgeeks.org/problems/bit-difference-1587115620/1)|None|↵
| 4 | [Power Set](https://practice.geeksforgeeks.org/problems/power-set4302/1#) |None|↵
| 5 | [Count Total Set Bits](https://practice.geeksforgeeks.org/problems/count-total-set-bits-1587115620/1#) |None|↵
| 6 | [And Then There Were K](https://codeforces.com/contest/1527/problem/A) |None|


#### I invite you all to add questions 
on [Link to repo[here](https://github.com/ankay212000/DS_ALGO_prep)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en5 English dkyu021 2021-05-23 20:58:47 449 New questions added
en4 English dkyu021 2021-05-20 23:47:26 217
en3 English dkyu021 2021-05-20 11:41:22 7 Tiny change: 'repo](http://https://gi' -> 'repo](https://gi'
en2 English dkyu021 2021-05-20 10:21:41 1045
en1 English dkyu021 2021-05-10 20:24:18 7712 Initial revision (published)