github repository of DSA challanges
difference of endl and \n
C datatypes
ascii table
negative number storeing
Switch
Miscellaneous
Time comlexity precedence
Sort zero's & one's (Dutch national flag problem)
Pascal Triangle
CODE SNIPPETS (swapping,reverse array)
Vector merge two vectors in new vector
sort colors
move all -ve no the left side of array
find duplicate Number
missing elements from an array with duplicate
Find first occurence
Common element in 3 sorted array
Wave print a matrix
Spiral print a matrix
add two number of array
find factorial of number
binary search
find first occurrence
find last occurrence
total number of occurrences
find peak element in mountain array
find pivot element in array
search in sorted rotated array
find square root
search in nearly sorted array
Divide two numbers using binary search
Binary search in 2D matrix
find missing elements (index based binary search)
find odd occuring element in an array
Selection sort
Bubble sort
Insertion sort
STL sort
custom sort
K-Diff Pairs In An Array
Find K-Closest Element
Exponential Search & Unbounded
Binary Search in infinite array
Book Allocation Problem
Painters Partition Problem
Aggresive Cows
EKO SPOJ
PRATA
Median or row wise sorted matrix
input string methods
check palindrome
remove duplicates
remove all occurrences of part from main string
valid palindrome 2
minimum time difference
palindromic substring
valid anagram
reverse only letters
longest common prefix
reverse vowels of as string
isomorphic string
reorganize string
group anagram
longest palindromix substring
find the index of first occurence in a string
string to integer (stoi)
string compression
Integers to Roman
Zigzag conversion
Largest number
Palindrome Partitioning
Seive of Erathosthenes - prime number
GCD euclid algorithm
Modulus properties
Fast exponential pow(a,b)
Find modulus of negative number
Pigeon hole
catalan number bst
inclusion exclusion principle
chinese reminder theorem
lucas's theorem
fermat's theorem
probability concepts
print 1 to n
factorial
fibonaci
climbing stairs
array print all element using recursion
find max in array using recursion
finding value in array using array
print all digits of number using recursion
finding is array sorted
Binary search using recursion
Subsequence of string
Coin exchange
Cut into segement
Maximum sum of adjacent elements
Last occurrence of a char
Reverse a string RE
Add string RE
palindrome check RE
Remove all occurrence of substring
print all subarrays using RE
Buy and sell stocks
House Robber
Integer to English words
Wild card Matching
Perfect squares
Minimum cost for tickets
Number of dice roll with target sum
merge sort
In place Merge sort
quick sort
permutation of string
house robber problem
rate in maze
sudoko solver
N Queen
generate paranthesis
phonekeypad problem
count inversion
inplace mergesort
max sub array sum
quicksort end element as pivot best way short
combination sum
combination sum II
permutation II
Beautiful arrangment
Distribute Repeating Integers
Static memory allocation
Dynamic memory allocation
1D array and 2D array heap memory
Constructor
Destructor
Encapsulation
Inheritance
Types of inheritance
Polymorphism
Abstraction
const keyword
mutable keyword
Initialization list
Macros
Shallow copy vs deep copy
local and global variables
Static keyword in class
Abstraction deep
Inline function
friend keyword
private constructor
Virtual constructor vs virtual destructor
Single LinkedList structure
find length of linkedlist
Insert at head
Insert at tail
Insert at position
Delete node at postion
Reverse Linked list using loops
Reverse linked list using recursion
find middle of Linked list
K group reverse Linked list
LL circular detection and deleting loop
LL is palindrome of not
Remove duplicates from sorted LL
Remove duplicates from unsorted LL
Sort 0's 1's and 2's in LL
Add two numbers represented by LL
Doubly linked list structure
print doubly linked list
length of doubly linked list
Insert at head
Insert at tail
Insert at position
Delete node from position
Merge 2 Sorted Linked List
Clone a Linked List with Random Pointer
Merge Sort in Linked list
Flatten a Linked List
Print kth node from end of Linked List
Intersection point of 2 Linked list
Rotate List (Leetcode)
Delete n nodes after m nodes (Leetcode)
Find min/max number between critical points (Leetcode)
Merge Node in between zeroes (Leetcode)
Stack operations
Custom stack implementation (without using STL)
Create 2 stack in one array
reverse string using stack
find middle element in stack
Insert at bottom of stack
reverse a stack using only one stack
Valid parenthesis
Sort a stack
Remove redundant brackets
Min stack (stack containg the minimum element in it)
longest valid parantheses
Next smaller element
Prev Smaller element
Largest rectangular area in histogram
Minimum Bracket Reversal
Remove All Adjacent Duplicates In String
Celebrity Problem
Next greater element in Linked List leetcode
N Stacks in an Array
Online Stock Span Leetcode
Check If Word Is Valid After Substitutions Leetcode
Decode Strings Leetcode
Car Fleet - I Leetcode
Car Fleet - 11 Leetcode
Simplify Path Leetcode
Max rectangle in Binary Matrix with all Is
Trapping rain Water
operations
custom implementation of Queue
Circular Queue
Input restricted Queue
Output restricted Queue
Doubly ended Queue(Deque)
Circular Doubly ended Queue
STL Deque
Reverse a queue
Reverse first k element of queue
Interleave first and second half of Queue
First -ve integer in every window of size k(sliding window + Queue)
Non-repeated character in a string
Gas Station
Sliding window maximum(sliding window + Queue)
Implement Queue using stack
Implement Stack using Queue
Implement k Queue in an array
Types of tree
Terms of tree
Tree traversal
Building tree
Level order Traversal
Inorder Traversal
Preorder Traversal
PostOrder Traversal
Maximum depth / height of binary tree
Maximum depth / height of N-ary tree
Diameter of tree
Check if two tree are identical or not
Check if two trees are mirror images of each other or not
Check if binary tree is balanced binary tree
Check whether BT is sum tree or not/ convert BST into sum tree
Lowest common ancestor
Kth ancestor
Path sum
Path sum II
Sum of longest bloodline
Build tree from inorder and preorder traversal
Top View of binary tree
Bottom view of binary Tree
left view of tree
right view of tree
boundary view of tree
Fast way to find diameter of tree
Fast way to determing that binary tree is balanced or not
Check 2 trees are identical or not
Check 2 trees are mirror of each other or not
Diagonal traversal of a binary tree
Zig-Zag traversal of a binary tree
Transform to Sum tree.
Vertical traversal of a binary tree.
Morris traversal of a binary tree
Sum of longest bloodline of a tree
K-sum path in a binary tree
Max sum of non-adjacent nodes in binary tree
Max time to burn a binary tree
Flatten a Binary tree into Linked List
Check if a Binary Tree contains duplicate subtrees of size 2 or more
Check for Children Sum Property in a Binary Tree
Serialize and Deserialize Binary Tree
BST creation
Searching in BST
Minimum and Maximum value in BST
Inorder predeccessor/successor
Deletion in BST
Validate BST
Lowest Common Ancestor
Kth smallest Element in a BST
Create BST from Inorder Traversal
Convert a BST into balanced BST
2 sum in BST
Convert BST into sorted doubly linked list
Sorted doubly LL into BST
Convert sorted List to BST
Find largest BST in binary tree
Merge 2 BST
Find inorder successor and inorder predecessor in a BST
Construct BST from preorder traversal
Count pairs from 2 BST whose sum is eqaul to given value 'X'
Convert a normal BST into balanced BST
Find the median of BST in O(n) time and O(1) space
Check whether BST contains Dead end
Flatten BST to sorted list
Count BST nodes that lie in a given range
Replace every element with least greater element on its right.
Valid BST from preorder
Heap
Max heap
Insertion in max Heap
Deletion in max heap
Heapify
Heap Sort
stl heap
kth smallest number in array
merge 2 max heap
find if complete binary tree is heap or not
convert bst into max heap
check given tree is CBT
merge k sorted array
merge k sorted LL
smallest range covering element from k lists
remove stones to minimize the total
make heap and heapify stl
reorganize string
longest happy string
find median from data stream
Check if tree is a heap
Merge 2 max heaps
K closest point to origin
Sliding window maximum
Get biggest three rhombus sums in a grid
Min diff in sum after element removal
Min number of refuelling stops
HashMap
HashMap stl
Implementation
Custom hashMap implementation
Using bucket array
Good hash function
Find freq of characters in string
Check circular LL
Tries
Trie structure
Longest common prefix
Implement dictornary
Mutliset to find min and max in single Data structure
Custom Sort String (using HashMap in class level)
Array subste of another array
Union of two linked list
Intersection of two linked list
Sum equal to sum
Largest subarray with 0 sum
Implement trie prefix tree
Replace words
Top K frequent words
Camelcase matching
Palindrome pairs
Approach
When to apply DP
Top down (Memoization)
Bottom Up (Tabulation)
Space Optimization
1D DP and 2D DP
Fibonacci
Coin change
House robber
Painting Fence
0/1 knapsack problem - 2D DP problem
Out of Boundary Paths - 3D DP problem
Partition equal subset sum
Number of dice roll with target
Minimum swaps to make sequence increasing
Guess number higher or lower II
Minimum cost tree leaf values
Unique binary search tree
DP on string
Find longes increasing subsequence
DP with binary search
Russian Doll envelopes
Maximum Height by stacking cuboids
Linear DP
DP on Strings
- Longest Palindromic SubString Leetcode
- Distinct Subsequences Leetcode
- Min ASCII Delete Sum for 2 Strings Leetcode
- Word Break 1 and 2 Leetcode
DP on Trees
DP on Intervals
LIS / LCS Variants
- Intervleaving Strings Leetcode
- Min Insertion steps to make a string palindrome Leetcode
- Min Number of Removals to make Mountain Array Leetcode
- Make Array Strictly increasing Leetcode
Buy & Sell Stocks Variants [all 5 variants] Leetcode
Knapsack DP
- Target Sum Leetcode
- Min Swaps to make Sequences increasing Leetcode
- Reducing Dishes Leetcode
- Ones and Zeroes Leetcode
MinMax DPs
Types of graph
Degree of node
In degree
Out degree
path
Acyclic Graph
Graph Implementation
Adjancency Matrix
Adjancency List
weighted adjancency list
Graph data structure
BFS and DFS traversal
Cycle Detection using BFS, DFS for Directed and undirected
Topological Sort using DFS & (BFS - kahn's algorithm)
Shortest path using BFS
Shortest path using DFS and Topological sort
Shortest path using Dijkstra algorithm set implementation
Shortest path Dijkstra (Word ladder problem priority queue implementation )
Cons of Dijkstra and its alternate solution
Shortest path Bellman Ford algorithm
Floyd Warshall
Strongly Connected component / Kosaraju algorithm
Bridge in a graph / Tarjan's algorithm
Number of provincies (BFS & DFS)
Number of island (DFS)
Flodd fill (DFS)
Rotting Oranges (BFS - find deepest level)
Course Schedule (topological sort)
Course Schedule II (topological sort)
Path with Minimum Effort (Dijkstra priority queue)
Critical Connection in a network (finding bridges)
Spanning Tree and Minimum spanning tree
Prim's algorithm
Kruskal's algorithm
Eventual Safe states
Word Ladder-2
Minimum Mulitiplication to reach End
Number of operation to make network Connected
Find the city with the smallest number of neighbours at a threshold distance
Accounts merge
Arrival time of train
Lollipop
DEFKIN
Min cost of ropes
Huffman encoding
Fractional knapsack
Chocolate Distribution
Fixed size window
Varaible size window
Two pointer approach
Optimized window
Smallest window in a string containing all the characters of another string
Odd/even checking
Bit masking
Change ith bit
Single number XOR logic duplication
Clear last ith bits
Check power of 2
Count set bits
Fast exponential
Clear range of bits
subsequence using bit masking
Interview Dos and Don'ts
Placement opportunities
Resume Review