450 DSA Questions
450 DSA Questions
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 Count pairs from 2 BST whose sum is equal to given value
Trees "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 Replace every element with the least greater element on
Trees its right
Binary Search Given "n" appointments, find the conflicting
Trees 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
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 & Check the expression has valid or Balanced parenthesis or
Queues not.
Stacks &
Queues Reverse a String using Stack
Stacks & Design a Stack that supports getMin() in O(1) time and
Queues 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 & Implement a method to insert an element at its bottom
Queues 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 & Stack Permutations (Check if an array is stack
Queues 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 & Sum of minimum and maximum elements of all subarrays
Queues of size “k”.
Stacks & Minimum sum of squares of character counts in a given
Queues string after removing “k” characters.
Stacks & Queue based approach or first non-repeating character in
Queues a stream.
Stacks &
Queues Next Smaller Element
Bit
Manipulation Count set bits in an integer
Bit Find the two non-repeating elements in an array of
Manipulation 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 Divide two integers without using multiplication, division
Manipulation and mod operator
Bit Calculate square of a number without using *, / and
Manipulation pow()
Bit
Manipulation Power Set