Binary Trees

Traversals

Spiral | ZigZag Traversal

Iterative

InOrder

PostOrder

PreOrder

Leaf Traversal

Level Order Traversal

Maximum Width of Binary Tree

Print Nodes at Level K

Recursive

PreOrder

PostOrder

InOrder

Node Depths

Boundary Traversal

Diagonal Traversal

Morris Traversal

getMax

getHeight

Check For Balanced Tree

getCount

Tree Comparisons

Are Symmetric Trees

Is Mirror Tree

SubTree of another tree

Tree Serialization

Find all duplicate subtrees

Serialize Tree

DE serialize Tree

Construct Tree From Bracket Rep

Branch Sum

Largest Subtree sum

Invert Binary Tree

Views

LeftView

BottomView

RightView

TopView

Building Tree From Array

Building Heap from an Array

Building Tree From PreOrder + InOrder

Building Tree From PostOrder + InOrder

Building Balanced BST from Sorted Array

Building BST from PreOrder

Ancestor

Lowest Common Ancesstor

With Parent Pointer (Binary Lifting)

Recursion

Kth Ancestor

BFS

Burn Leaf from a Node (BFS)

Nodes at Distance K

Misc

Count Nodes in Complete Binary Tree

Find path between two nodes

InOrder Successor | Predecessor

Conversions

Tree -> DLinkedList

Binary Tree -> SumTree

BST -> Heap

Binary Tree -> BST

Min No of swaps required to convert BT to BST

Main topic

Binary Search Tree

Max of BST

Min of BST

Find element in BST

Kth Smallest/Largest

Target Sum pair in BST (Iterative Traversal)

Largest BST in BT

Balance BST

Check if tree is BST

Merge two BST

Count nodes of BST in given Range

Median of BST

DP with Trees

Max Path Sum Between Two Nodes

Between any two

Between two leaf nodes

Diameter of Tree

Largest Independent Set

Heaps

Implementation

Removing Element from heap

Find Element in heap

Add ele to heap

Merge two binary Heaps

Heapify Up

Heapify Down

Heap Sort

Optimal Merge Pattern

Connect Ropes to Minimize the cost

Merge K sorted Arrays | Lists

Max of all SubArrays of Size K (Sliding Window)

Frequency Sort

Sort K sorted Array

Top K/ or Kth Pattern

K Closest Numbers

Kth Largest/Smallest

Top K frequent Numbers

K closest Points to Origin

LinkedList

Implementation

Delete without head pointer

Rotate Linkedlist

Clock Wise

Anti Clock WIse

Check Palindrome

Modification

Reversal

Iterative

Recursive

Using Stack

Swap Pair Wise

K Group Reversal

Number Theory

Add Two Lists

Multiply Two Lists

Factorial of a large number

Quick Sort

Floyd Cycle Detection

Detecting loop

Removing loop

Other

Beautiful Number

Find Duplicate Number

Segregate Odd/Even Nodes

Merge Sort

Find Middle Element

Merge two lists

Merge K sorted Lists

Cloning with random pointer

LRU Implementation

Remove duplicates

Sorted

Unsorted

Binary Search

Search In Asc Order

First Occurence

Last Occurence

Search in Desc Order

Last Occurence

First Occurence

Search in 2D sorted matrix

Bitonic Array

Search in Bitonic Array

With Dup

Without Dup

Find Peak Element

Search in Infinite Space

Misc

Group1

Aggresive Cows

Allocate No of Pages

Painters Partition Problem

Roti and paratha

Weighted Job Scheduling

Single Element in a sorted array

Duplicate Substring (BS + DP | BS + Trie)

Palindromic Substring (BS + DP | BS + Trie)

Weighted Job Scheduling

Rotated Array

No of times array rotated/Find Min in rotated array

Find ele in rotated array

Without Dup

With Dup

K-Sorted Array

On Nearly Sorted Array

Not Found Cases

Floor

Next Letter

Ceil

Row with Max 1's

Nth Square Root

Square root of Number

With Given Precision

Floor value

Stack

Elimination Problems

Celebrity Problem

Postfix Evaluation

Convert Infix to Postfix

Duplicate Brackets

Implementation

Stack Implementation Using Array

Two Stacks in an Array

Single Stack

Implement Priority Queue With Stack | Min Stack

LeftMost/RightMost Positional Queries

Next Element

Next Smaller Element to Right

Next Smaller Element to Left

Next Greater Element to Right

Next Greater Element to Left

Stock Span Problem

Max Area of Histogram

Max Area of Binary Matrix

Rain Water Tapping Problem

Validate Stack Sequence

Merging Overlapping Intervals

Parenthesis

Balance Parenthesis

Longest Valid Parenthesis

Generate All Valid Parenthesis

Remove K digits to make number small

Dynamic Programming

Longest Increasing SubSeq

Print Longest Increasing Subseq

Russian Dolls | Envelops

Max Chain Length

Largest Divisible Subset

Reach End Problem
1.Total No of Ways
2. Min steps

Top Down + Bottom Up

Ways To Decode

Reach Nth Step

Jump Game/ Frog Jump

Can you reach end

Min Jumps to reach end

Coin Change Problem

Skipping Adjacent Elements

House Robber Problem I

House Robber Problem II (Circular Array)

House Robber III (Largest Independent Subset)

0-1 Knapsack

Max Profit

Print Solution

Bottom Up @ Space Optimized

TopDown

SubArray|Partition Problems

1.Top Down
2.Bottom Up
3. Printing the solution
4. TC Analysis

Min no of Palindrome Partitions

No of ways of evaluating an expression to true

Scrambled Strings

Dropping Egg problem

Word Break Problem

Interleaving of two | n strings

check if the string is interleaved by two|n strings

Generate all interleavings of two strings

Wine Selling Problem

Subset Sum

1.Count Subsets
2.Print Solution
3.Bottom Up @Space Optimized
4.TopDown

SubSet Sum Difference (K)

Min SubSet Sum Difference/ Tug of War

Target Sum

Equal Subset Sum Partition

Longest Common SubSeq

Find LCS

Longest Repeating Subseq

Shortest Common superseq

Min Insertions/Deletions to convert string a to b

Longest Palindromic Subseq

Longest Common Substring

Distinct Subsequences

Uncrossed Lines

MaxSubArray Sum | Kadane

Longest

Shortest

Maximum Rectangle in a given Matrix

Grid Problems

No of ways to reach to end of grid

With obstacles

Without Obstacles

Gold Mine Problem

Dungeon | Knight Game

Maximal Square with all 1

Count Squares with all 1's

String Comparisions

Validate string + regex

String Edit Distance

Dice Throw Problem @TotalNoOfWays

Sliding Window

Fixed

Max of all subarray sums of size k

First Negative of subarray k

Count Anagram Occurences

Max of all maxes of subarray of size k

Variable

1.Longest
2.Shortest

Subarray with given sum (only positive)

K Unique characters subarray

All Distinct Characters

Pick toys (Max k types)

Minimum Window Substring

Smallest Subarray with atleast K sum

Greedy Algorithms

Interval

Max Interval Scheduling

Merge Intervals

Max Job Scheduling with deadlines

Huffman Coding

Fractional Knapsack

Min taps to Sprinkle Water

Swap sort

Min swaps required to sort an array

Count cycles in array

HashMap

SubArray

K Sum

Count SubArrays of Sum K

Longest/Shortest SubArray of Sum K

Zero Sum

Count SubArrays of Sum zero

Longest/Shortest SubArray of Sum zero

Sum divisible by K

Count SubArrays of
Sum divisible by K

Longest/Shortest SubArray of
Sum divisible by K

Equal No of 0,1,2

Count

Longest/Shortest

Equal No of 0,1

Count

Longest/Shortest

Array Pairs Divisible by K

Smallest SubArray With
All Occurrences of Most Freq Element

Arrays

Minimum Adjacent Absolute Difference

Two Sum

Three Sum

Quadruplet Sum

Max Product SubSet

Triplet Sum

Max SubArray Sum | Kadane