Please answer the questions in the "AnswerX.cpp" format..
This repositiory is to help begineers with open source..
Q1) Sort an array of 0’s 1’s 2’s without using extra space or sorting algorithm.
Q2) Repeat and Missing Number.
Q3) Merge two sorted Arrays without extra space.
Q4) Kadane’s Algorithm.
Q5) Merge Overlapping Subintervals.
Q6) Find the duplicate in an array of N+1 integers.
Q7) Set Matrix Zeroes.
Q8) Pascal Triangle.
Q9) Next Permutation.
Q10) Inversion of Array (Using Merge Sort).
Q11) Stock Buy and Sell.
Q12) Rotate Matrix.
Q13) Search in a 2D matrix.
Q14) Pow(X,n).
Q15) Majority Element (>N/2 times).
Q16) Majority Element (>N/3 times).
Q17) Grid Unique Paths.
Q18) Reverse Pairs.
Q19) 2 Sum problem.
Q20) 4 Sum problem.
Q21) Longest Consecutive Sequence.
Q22) Largest Subarray with 0 sum.
Q23) Count number of subarrays with given XOR(this clears a lot of problems).
Q24) Longest substring without repeat.
Q25) Reverse a LinkedList.
Q26) Find middle of LinkedList.
Q27) Merge two sorted Linked List.
Q28) Remove N-th node from back of LinkedList.
Q29) Delete a given Node when a node is given. (0(1) solution).
Q30) Add two numbers as LinkedList.
Q31) Find intersection point of Y LinkedList.
Q32) Detect a cycle in Linked List.
Q33) Reverse a LinkedList in groups of size k.
Q34) Check if a LinkedList is palindrome or not.
Q35) Find the starting point of the Loop of LinkedList.
Q36) Flattening of a LinkedList.
Q37) Rotate a LinkedList.
Q38) Clone a Linked List with random and next pointer.
Q39) 3 sum.
Q40) Trapping rainwater.
Q41) Remove Duplicate from Sorted array.
Q42) Max consecutive ones.
Q43) Level order Traversal / Level order traversal in spiral form.
Q44) Height of a Binary Tree.
Q45) Diameter of Binary Tree.
Q46) Check if Binary tree is height balanced or not.
Q47) LCA in Binary Tree.
Q48) Check if two trees are identical or not.
Q49) Maximum path sum.
Q50) Construct Binary Tree from inorder and preorder.
Q51) Construct Binary Tree from Inorder and Postorder.
Q52) Symmetric Binary Tree.
Q53) Flatten Binary Tree to LinkedList.
Q54) Check if Binary Tree is mirror of itself or not.
Q55) Print Adjacency List.
Q56) Print BFS of a graph.
Q57) Print DFS of a graph.
Q58) Find Transitive closure of a graph.
Q59) Union Find.
Q60) Detect cycle using DSU in graph.
Q61) Number of Provinces.
Q62) Find the number of islands.
Q63) Detect cycle in an undirected graph.
Q64) Hamiltonian Path.
Q65) Prerequisites Tasks.
Q66) COurse SChedule.
Q67) Circle of Strings.
Q68) Snake and Ladder problem.
Q69) Bipartite graph.
Q70) Maximum BIpartite Matching.
Q71) Allocate Books.
Q72) Aggresive Cow.
Q72) Celebrity Problem.
Q73) Largest Rectangle in Histogram.
Q74) Rat in a maze.
Q75) Valid parenthesis.
Q76) Reverse stack using recursion.
Q77) Delete middle element in stack.
Q78) Redundant brackets.
Q79) 0-1 Knapsack Problem
Q80) Flatten Nested List Iterator.
Q81) Number of Students Unable to Eat Lunch.
Arrays1:
Q1.1) Sort an array of 0’s 1’s 2’s without using extra space or sorting algorithm.
Q1.2) Repeat and Missing Number.
Q1.3) Merge two sorted Arrays without extra space.
Q1.4) Kadane’s Algorithm.
Q1.5) Merge Overlapping Subintervals.
Q1.6) Find the duplicate in an array of N+1 integers.
Q1.7) Set Matrix Zeroes.
Q1.8) Pascal Triangle.
Q1.9) Next Permutation.
Q1.10) Inversion of Array (Using Merge Sort).
Q1.11) Stock Buy and Sell.
Q1.12) Rotate Matrix.
Will be adding question related to other data structures soon.