### Complete DS ALGO in 450 Questions First Step to become a SOFTWARE ENGINEER

Love Babbar is a famous Youtuber, a graduate from NSUT Delhi who has also worked as a Software Engineer in Amazon.

### DSA Sheet By Love Babbar

 Searching & Sorting Find first and last positions of an element in a sorted array Searching & Sorting Find a Fixed Point (Value equal to index) in a given array Searching & Sorting Search in a rotated sorted array Searching & Sorting square root of an integer Searching & Sorting Maximum and minimum of an array using minimum number of comparisons Searching & Sorting Optimum location of point to minimize total distance Searching & Sorting Find the repeating and the missing Searching & Sorting find majority element Searching & Sorting Searching in an array where adjacent differ by at most k Searching & Sorting find a pair with a given difference Searching & Sorting find four elements that sum to a given value Searching & Sorting maximum sum such that no 2 elements are adjacent Searching & Sorting Count triplet with sum smaller than a given value Searching & Sorting merge 2 sorted arrays Searching & Sorting print all subarrays with 0 sum Searching & Sorting Product array Puzzle Searching & Sorting Sort array according to count of set bits Searching & Sorting minimum no. of swaps required to sort the array Searching & Sorting Bishu and Soldiers Searching & Sorting Rasta and Kheshtak Searching & Sorting Kth smallest number again Searching & Sorting Find pivot element in a sorted array Searching & Sorting K-th Element of Two Sorted Arrays Searching & Sorting Aggressive cows Searching & Sorting Book Allocation Problem Searching & Sorting EKOSPOJ: Searching & Sorting Job Scheduling Algo Searching & Sorting Missing Number in AP Searching & Sorting Smallest number with atleastn trailing zeroes infactorial Searching & Sorting Painters Partition Problem: Searching & Sorting ROTI-Prata SPOJ Searching & Sorting DoubleHelix SPOJ Searching & Sorting Subset Sums Searching & Sorting Findthe inversion count Searching & Sorting Implement Merge-sort in-place Searching & Sorting Partitioning and Sorting Arrays with Many Repeated Entries
 Binary Trees level order traversal Binary Trees Reverse Level Order traversal Binary Trees Height of a tree Binary Trees Diameter of a tree Binary Trees Mirror of a tree Binary Trees Inorder Traversal of a tree both using recursion and Iteration Binary Trees Preorder Traversal of a tree both using recursion and Iteration Binary Trees Postorder Traversal of a tree both using recursion and Iteration Binary Trees Left View of a tree Binary Trees Right View of Tree Binary Trees Top View of a tree Binary Trees Bottom View of a tree Binary Trees Zig-Zag traversal of a binary tree Binary Trees Check if a tree is balanced or not Binary Trees Diagnol Traversal of a Binary tree Binary Trees Boundary traversal of a Binary tree Binary Trees Construct Binary Tree from String with Bracket Representation Binary Trees Convert Binary tree into Doubly Linked List Binary Trees Convert Binary tree into Sum tree Binary Trees Construct Binary tree from Inorder and preorder traversal Binary Trees Find minimum swaps required to convert a Binary tree into BST Binary Trees Check if Binary tree is Sum tree or not Binary Trees Check if all leaf nodes are at same level or not Binary Trees Check if a Binary Tree contains duplicate subtrees of size 2 or more [ IMP ] Binary Trees Check if 2 trees are mirror or not Binary Trees Sum of Nodes on the Longest path from root to leaf node Binary Trees Check if given graph is tree or not.  [ IMP ] Binary Trees Find Largest subtree sum in a tree Binary Trees Maximum Sum of nodes in Binary tree such that no two are adjacent Binary Trees Print all “K” Sum paths in a Binary tree Binary Trees Find LCA in a Binary tree Binary Trees Find distance between 2 nodes in a Binary tree Binary Trees Kth Ancestor of node in a Binary tree Binary Trees Find all Duplicate subtrees in a Binary tree [ IMP ] Binary Trees Tree Isomorphism Problem
 Binary Search Trees Fina a value in a BST Binary Search Trees Deletion of a node in a BST Binary Search Trees Find min and max value in a BST Binary Search Trees Find inorder successor and inorder predecessor in a BST Binary Search Trees Check if a tree is a BST or not Binary Search Trees Populate Inorder successor of all nodes Binary Search Trees Find LCA  of 2 nodes in a BST Binary Search Trees Construct BST from preorder traversal Binary Search Trees Convert Binary tree into BST Binary Search Trees Convert a normal BST into a Balanced BST Binary Search Trees Merge two BST [ V.V.V>IMP ] Binary Search Trees Find Kth largest element in a BST Binary Search Trees Find Kth smallest element in a BST Binary Search Trees Count pairs from 2 BST whose sum is equal to given value “X” Binary Search Trees Find the median of BST in O(n) time and O(1) space Binary Search Trees Count BST ndoes that lie in a given range Binary Search Trees Replace every element with the least greater element on its right Binary Search Trees Given “n” appointments, find the conflicting appointments Binary Search Trees Check preorder is valid or not Binary Search Trees Check whether BST contains Dead end Binary Search Trees Largest BST in a Binary Tree [ V.V.V.V.V IMP ] Binary Search Trees Flatten BST to sorted list
 BackTracking Rat in a maze Problem BackTracking Printing all solutions in N-Queen Problem BackTracking Word Break Problem using Backtracking BackTracking Remove Invalid Parentheses BackTracking Sudoku Solver BackTracking m Coloring Problem BackTracking Print all palindromic partitions of a string BackTracking Subset Sum Problem BackTracking The Knight’s tour problem BackTracking Tug of War BackTracking Find shortest safe route in a path with landmines BackTracking Combinational Sum BackTracking Find Maximum number possible by doing at-most K swaps BackTracking Print all permutations of a string BackTracking Find if there is a path of more than k length from a source BackTracking Longest Possible Route in a Matrix with Hurdles BackTracking Print all possible paths from top left to bottom right of a mXn matrix BackTracking Partition of a set intoK subsets with equal sum BackTracking Find the K-th Permutation Sequence of first N natural numbers
 Stacks & Queues Implement Stack from Scratch Stacks & Queues Implement Queue from Scratch Stacks & Queues Implement 2 stack in an array Stacks & Queues find the middle element of a stack Stacks & Queues Implement “N” stacks in an Array Stacks & Queues Check the expression has valid or Balanced parenthesis or not. Stacks & Queues Reverse a String using Stack Stacks & Queues Design a Stack that supports getMin() in O(1) time and O(1) extra space. Stacks & Queues Find the next Greater element Stacks & Queues The celebrity Problem Stacks & Queues Arithmetic Expression evaluation Stacks & Queues Evaluation of Postfix expression Stacks & Queues Implement a method to insert an element at its bottom without using any other data structure. Stacks & Queues Reverse a stack using recursion Stacks & Queues Sort a Stack using recursion Stacks & Queues Merge Overlapping Intervals Stacks & Queues Largest rectangular Area in Histogram Stacks & Queues Length of the Longest Valid Substring Stacks & Queues Expression contains redundant bracket or not Stacks & Queues Implement Stack using Queue Stacks & Queues Implement Stack using Deque Stacks & Queues Stack Permutations (Check if an array is stack permutation of other) Stacks & Queues Implement Queue using Stack Stacks & Queues Implement “n” queue in an array Stacks & Queues Implement a Circular queue Stacks & Queues LRU Cache Implementationa Stacks & Queues Reverse a Queue using recursion Stacks & Queues Reverse the first “K” elements of a queue Stacks & Queues Interleave the first half of the queue with second half Stacks & Queues Find the first circular tour that visits all Petrol Pumps Stacks & Queues Minimum time required to rot all oranges Stacks & Queues Distance of nearest cell having 1 in a binary matrix Stacks & Queues First negative integer in every window of size “k” Stacks & Queues Check if all levels of two trees are anagrams or not. Stacks & Queues Sum of minimum and maximum elements of all subarrays of size “k”. Stacks & Queues Minimum sum of squares of character counts in a given string after removing “k” characters. Stacks & Queues Queue based approach or first non-repeating character in a stream. Stacks & Queues Next Smaller Element
 Dynamic Programming Coin ChangeProblem Dynamic Programming Knapsack Problem Dynamic Programming Binomial CoefficientProblem Dynamic Programming Permutation CoefficientProblem Dynamic Programming Program for nth Catalan Number Dynamic Programming Matrix Chain Multiplication Dynamic Programming Edit Distance Dynamic Programming Subset Sum Problem Dynamic Programming Friends Pairing Problem Dynamic Programming Gold Mine Problem Dynamic Programming Assembly Line SchedulingProblem Dynamic Programming Painting the Fenceproblem Dynamic Programming Maximize The Cut Segments Dynamic Programming Longest Common Subsequence Dynamic Programming Longest Repeated Subsequence Dynamic Programming Longest Increasing Subsequence Dynamic Programming Space Optimized Solution of LCS Dynamic Programming LCS (Longest Common Subsequence) of three strings Dynamic Programming Maximum Sum Increasing Subsequence Dynamic Programming Count all subsequences having product less than K Dynamic Programming Longest subsequence such that difference between adjacent is one Dynamic Programming Maximum subsequence sum such that no three are consecutive Dynamic Programming Egg Dropping Problem Dynamic Programming Maximum Length Chain of Pairs Dynamic Programming Maximum size square sub-matrix with all 1s Dynamic Programming Maximum sum of pairs with specific difference Dynamic Programming Min Cost PathProblem Dynamic Programming Maximum difference of zeros and ones in binary string Dynamic Programming Minimum number of jumps to reach end Dynamic Programming Minimum cost to fill given weight in a bag Dynamic Programming Minimum removals from array to make max –min <= K Dynamic Programming Longest Common Substring Dynamic Programming Count number of ways to reacha given score in a game Dynamic Programming Count Balanced Binary Trees of Height h Dynamic Programming LargestSum Contiguous Subarray [V>V>V>V IMP ] Dynamic Programming Smallest sum contiguous subarray Dynamic Programming Unbounded Knapsack (Repetition of items allowed) Dynamic Programming Word Break Problem Dynamic Programming Largest Independent Set Problem Dynamic Programming Partition problem Dynamic Programming Longest Palindromic Subsequence Dynamic Programming Count All Palindromic Subsequence in a given String Dynamic Programming Longest Palindromic Substring Dynamic Programming Longest alternating subsequence Dynamic Programming Weighted Job Scheduling Dynamic Programming Coin game winner where every player has three choices Dynamic Programming Count Derangements (Permutation such that no element appears in its original position) [ IMPORTANT ] Dynamic Programming Maximum profit by buying and selling a share at most twice [ IMP ] Dynamic Programming Optimal Strategy for a Game Dynamic Programming Optimal Binary Search Tree Dynamic Programming Palindrome PartitioningProblem Dynamic Programming Word Wrap Problem Dynamic Programming Mobile Numeric Keypad Problem [ IMP ] Dynamic Programming Boolean Parenthesization Problem Dynamic Programming Largest rectangular sub-matrix whose sum is 0 Dynamic Programming Largest area rectangular sub-matrix with equal number of 1’s and 0’s [ IMP ] Dynamic Programming Maximum sum rectangle in a 2D matrix Dynamic Programming Maximum profit by buying and selling a share at most k times Dynamic Programming Find if a string is interleaved of two other strings Dynamic Programming Maximum Length of Pair Chain
 Bit Manipulation Count set bits in an integer Bit Manipulation Find the two non-repeating elements in an array of repeating elements Bit Manipulation Count number of bits to be flipped to convert A to B Bit Manipulation Count total set bits in all numbers from 1 to n Bit Manipulation Program to find whether a no is power of two Bit Manipulation Find position of the only set bit Bit Manipulation Copy set bits in a range Bit Manipulation Divide two integers without using multiplication, division and mod operator Bit Manipulation Calculate square of a number without using *, / and pow() Bit Manipulation Power Set

## Extra Feature Of This Website Click Icons ##### PrepInsta Top 100 Codes
These codes are very important since these will help you clear your basic concepts in various languages.
##### Striver’s SDE Sheet – Top Coding Interview Problems.
Check out the Most Asked Coding Interview Problem list compiled .
##### DSA alg by Love Babbar Sheet With solution\$ code
Love Babbar is a famous Youtuber, a graduate from NSUT Delhi who has also worked as a Software Engineer in Amazon.