- Check For BST
Naive O(N^2) O(H)
Assigning Ranges O(N) O(H)
Storing Inorder Traversal O(N) O(N)
Without Storing Inorder Traversal O(N) O(H)
- Reverse a linked list
Naive O(N) O(N)
Changing the arrows O(N) O(1)
Recursive with Global O(N) O(N)
Recurssive without Global O(N) O(N)
- Finding middle element in a linked list
Naive Two Traversal O(N) O(1)
Fast Slow Pointers Iterative O(N) O(1)
Fast Slow Pointers Recurssive O(N) O(N)
- Longest Palindrome in a String
Bottom-Up DP O(N^2) O(N^2)
- Check if Linked List is Palindrome
- Get minimum element from stack
- Intersection Point in Y Shapped Linked Lists
- Delete without head pointer
- Determine if Two Trees are Identical
- BFS of graph
- Diameter of Binary Tree
- Detect cycle in a directed graph
- Mirror Tree
- Add two numbers represented by linked lists
- Level order traversal in spiral form
- Reverse a Linked List in groups of given size
- Search in a Rotated Array
- Boundary Traversal of binary tree
- Level order traversal
- Longest Common Substring
- Lowest Common Ancestor in a BST
- Merge two sorted linked lists
- Root to leaf path sum
- Implement Atoi
- Count distinct elements in every window
- Maximum Path Sum between 2 Leaf Nodes
- Connect Nodes at Same Level
- First non-repeating character in a stream
- Pairwise swap elements of a linked list
- Longest Distinct characters in string
- Queue using two Stacks
- The Celebrity Problem
- Multiply two strings
- Circular tour
- Binary Tree to DLL
- Level order traversal Line by Line
- Lowest Common Ancestor in a Binary Tree
- Relative Sorting
- Find the number of islands
- Flattening a Linked List
- Insert a node in a BST
- Implement strstr
- Merge Sort
- Square root
- Validate an IP Address
- Topological sort
- Given a linked list of 0s, 1s and 2s, sort i
- Implement Stack using Linked List
- Minimum element in a sorted and rotated arra
- Check if subtree
- Word Boggle
- Implement two stacks in an array
- Reverse Level Order Traversal
- K distance from root
- Minimum element in BST
- Interleaved Strings
- Intersection of two sorted Linked lists
- Sorted insert for circular linked list
- Check If Circular Linked List
- Kadane's Algorithm
- Sort an array of 0s, 1s and 2s
- Ease the Array
- Intersection of Two Linked Lists
- Delete Middle of Linked List
- Stock buy and sell
- Delete N nodes after M nodes of a linked lis
- Factorials of large numbers
- Column name from a given column number
- Overlapping rectangles
- Serialize and Deserialize a Binary Tree
- Print BST elements in given range
- Find the fine
- Construct Tree from Inorder & Preorder
- Reverse words in a given string
- Transform to Sum Tree
- Reorder List
- Check if Tree is Isomorphic
- Merge k Sorted Arrays
- Majority Element
- Run Length Encoding
- Print Pattern
- Clone a linked list with next and random poi
- Nearest multiple of 10
- Max rectangle
- Knight Walk
- Maximum in Struct Array
- Count Number of SubTrees having given Sum
- Merge Without Extra Space
- Fixing Two nodes of a BST
- Construct Binary Tree from Parent Array
- Merge Without Extra Space
- Merge Sort for Linked List
- Box Stacking
- Inversion of array
- Merge two BST 's
- A Simple Fraction
- Missing number in array
- Alien Dictionary
- Unit Area of largest region of 1's
- Union of Two Linked Lists
- Merge 2 sorted linked list in reverse order
- Buildings receiving sunlight
- Boolean Parenthesization
- Spirally traversing a matrix
- Maximum Product Subarray
- Phone directory
- Convert to Roman No
- 0 - 1 Knapsack Problem
- Sum of Leaf Nodes at Min Level
- Reverse each word in a given string
- longest substring containing '1'
- Node at distance
- Common elements
- Longest Even Length Substring
- Kth smallest element
- Stock buy and sell
- URLify a given string
- Match specific pattern
- Non Repeating Character
- Decode the pattern
- Subsets
- Unit Area of largest region of 1's
- Delete nodes greater than k
- Length of longest palindrome in linked list
- Coin Change
- Lucky Numbers
- Longest Palindrome Substring
- String Ignorance
- Rotate by 90 degree
- Difficulty of sentence
- Find the string in grid
- k largest elements
- Remove common characters and concatenate
- Rotate by 90 degree
- Arranging the array
- Solve the Sudoku
- K largest elements
- Maximize The Array
- Find All Four Sum Numbers
- Travelling Salesman Problem
- Key Pair
- Word Boggle
- Longest Palindromic Substring in Linear Time
- Replace the Bit
- Word Wrap
- Zero Sum Subarrays
- Brackets in Matrix Chain Multiplication
- Generate Grey Code Sequences
- Largest Number formed from an Array
- Find median in a stream
- Rotten Oranges
- Remove Duplicates
- Closest Number
- Finding Number
- Subsets
- Relative Sorting
- Optimal Strategy For A Game
- RegEx matching
- Combination Sum
- Consecutive 1's not allowed
- Finding the numbers
- Roman Number to Integer
- Word Break
- Number of paths
- Shortest Common Supersequence
- Perfect Sum Problem
- Is Binary Number Multiple of 3
- Arithmetic Progression
- Two numbers with sum closest to zero
- Find position of set bit
- Longest Bitonic subsequence
- Count Occurences of Anagrams
- Sum of two large numbers
- Add Binary Strings
- Remove all duplicates from a given string
- Mobile numeric keypad
- Palindrome numbers
- Tic Tac Toe
- Design a tiny URL or URL shortener
- Integer to Words
- Next Smallest Palindrome
- Minimum Points To Reach Destination
- Binary representation
- Strictly Increasing Array
- Sort in specific order
- Day of the week
- Maximum no of 1's row
- Minimize string value
- Nth item through sum
- Next greater number set digits
- Carry counter
- Transform the array
- String comparison