Data Structures and Algorithms
Introduction
C++
Sorting
1. Bubble Sort
2. Selection Sort
3. Insertion Sort
4. Merge Sort
5. Quick Sort
6. Heap Sort
7. Counting Sort
8. Bucket Sort
9. Radix Sort
10. Sort Nearly Sorted Array
Math
1. Plus One
2. Reverse Integer
3. Write your own atoi
4. Fizz Buzz
5. *Count Primes
6. Roman to Integer
7. Happy Number
8. Max Increase to Keep City Skyline
9. Flipping an Image
10. Excel Sheet Column Number
11. Excel Sheet Column Title
Array
Rotations
1. Rotate array by n
2. Reversal algorithm for array rotation
3. Rotate Matrix
4. *Diagonal Traverse
Arrangement and Rearrangement
1. Maximum Product of Three Numbers
2. Array Partition : max sum of min pair
3. Reshape the Matrix
4. *Beautiful Arrangement
5. *Beautiful Arrangement II
Searching and Sorting
1. Majority Element
2. Remove Element In Place
3. Two Sum
4. Remove Duplicates from Sorted Array
5. Remove Duplicates from Sorted Array II
6. Toeplitz Matrix (Check diagonal)
7. *Merge Sorted Array
8. Merge Overlapping Intervals
9. Max Area of Island
10. Largest Number At Least Twice of Others
11. Find All Numbers Disappeared in an Array
12. Find All Duplicates in an Array
13. FInd Pivot Index
14. *Degree of Array
15. *Top K Frequent Elements
16. Insert Interval
17. Wave Array
18. *Max Distance
19. *Majority Element II
20. Single Number
21. Number of Islands
22. Minimum Size Subarray Sum
Order Statistics
1. Best Time to Buy and Sell Stock
2. Best Time to Buy and Sell Stock II
3. Best Time to Buy and Sell Stock III
4. Longest Continuous Increasing Subsequence
5. Missing Number
6. *Non-Decreasing Array
7. Third Maximum Number
8. *Maximum Subarray Sum
9. Max Non Negative SubArray
10. Plus One
11. Valid Sudoku
12. Kth Largest Element in an Array
Matrix
1. Spiral Matrix
2. Spiral Matrix II
3. Pascal's Triangle
4. Pascal's Triangle II
5. Minesweeper
String
Pattern Search
1. *Searching for Patterns : Implement strStr
2. *Longest Common Prefix
3. *Word Pattern
Anagram
1. Valid Anagram
2. Group Anagrams
3. Find All Anagrams in a String
Character Counting Based Problems
1. Count and Say
3. Sort Characters By Frequency
4. *Top K Frequent Words
Judge Route Circle
Subsequence
1. Minimum Window Substring
2. Length Of Longest Substring Two Distinct
3. Longest Substring with At Most K Distinct Characters
4. Longest Substring Without Repeating Characters
5. Reorganize String
Max Sliding Window
Misc
1. Reverse Words In String
2. Reverse Words in a String III
3. *Reverse String II
4. *First Unique Character in a String
5. One Edit Distance
6. *Add Binary
Linked List
Deletion
1. Linked List Deletion
2. Remove Node From Linked List
3. Remove Nth Node From End of List
1. Linked List Insertion
4. Find Length
5. *Swap nodes in a linked list
6. Linked List Cycle
7. Reverse List
8. Remove duplicates from sorted linked list
9. *Intersection of Two Linked Lists
10. *Merge Sorted List
11. Add Two Numbers
12. Add Two Numbers II
13. Swap Nodes in Pairs
14. *Merge k Sorted Lists
15. Copy List with Random Pointer
Palindrome
1. Valid Palindrome
2. Valid Palindrome II : Delete one char
3. Longest Palindrome
4. Palindrome Permutation
5. Palindrome Number
6. *Palindrome Linked List
Stack
1. Valid Parentheses
2. Next Greater Element
3. Min Stack
4. Basic Calculator
5. Basic Calculator II
6. Basic Calculator III
7. Exclusive Time of Functions
Asteroid Collision
Binary Search
1. Square Root
2. Guess Number Higher or Lower
3. Guess Number Higher or Lower II
4. *Search in Rotated Sorted Array
5. *Search in Rotated Sorted Array II
6. First Bad Version
7. Find Peak Element
8. *Find Minimum in Rotated Sorted Array
9. *Find Minimum in Rotated Sorted Array II
10. *Search for a Range
Find K Closest Elements
Binary Tree
Traversal
1. Preorder Traversal
2. Inorder Traversal
3. *Postorder Traversal
4. *Level Order Traversal
5. Level Order Traversal II
6. Binary Tree Path
7. Merge Two Binary Trees
8. Minimum Depth of Binary Tree
9. Maximum Depth of Binary Tree
10. Average of Levels in Binary Tree
11. Construct String from Binary Tree
12. Sum of Left Leaves
13. Binary Tree Tilt
Construction & Conversion
1. Construct Binary Tree from Preorder and Inorder Traversal
2. Construct Binary Tree from Inorder and Postorder Traversal
Lowest Common Ancestor
1. Lowest Common Ancestor of a Binary Tree
2. Lowest Common Ancestor in a Binary Search Tree
Misc
1. *Symmetric Tree
2. Populating Next Right Pointers in Each Node
3. Populating Next Right Pointers in Each Node II
4. *Serialize and Deserialize Binary Tree
5. Path Sum
6. Path Sum II
7. Path Sum III
8. Maximum Binary Tree
9. Binary Tree Pruning
Binary Search Tree
Basic Operations
1. Validate Binary Search Tree
2. Search In BST
3. Insertion
4. *Deletion
5. *Inorder Successor
6. BST Iterator
7. Serialize and Deserialize BST
Construction and Conversion
Convert Sorted Array to Binary Search Tree
Check and Smallest/Largest Element
1. K'th Smallest Element in BST
2. K’th Largest Element in BST
Check if given sorted sub-sequence exists in binary search tree
Check whether BST contains Dead End or not
Check if an array represents Inorder of Binary Search tree or not
Check if two BSTs contain same set of elements
Largest number in BST which is less than or equal to N
Red Black Tree and Threaded Binary Tree
Misc
Trim a Binary Search Tree
Lowest Common Ancestor in a Binary Search Tree
Bit Manipulation
1. Hamming Distance
2. Reverse Bits
3. Number of 1 Bits
4. Palindrome Number
5. Palindrome Number II
6. Power of Two
7. Power of Three
8. Power of Four
BFS and DFS
1. Employee Importance
2. Nested List Weight Sum
3. Flood Fill
4. *01 Matrix
5. Max Area of Island
Graph
Graph Traversal
1. Breadth First Traversal
2. Depth First Traversal
3. Clone Graph
Graph Cycle
1. Course Schedule
Heap
1. Heap Sort
Dynamic Programming
1. Fibonacci Numbers
2. Climbing Stairs
3. Longest Palindromic Subsequence
4. House Robber
5. House Robber II
6. House Robber III
7. Word Break
8. Decode Ways
Longest Common Subsequence
Backtracking
1. Letter Case Permutation
2. Binary Watch
3. Beautiful Arrangement
4. Beautiful Arrangement II
5. Permutations
6. Permutations II
7. Combination Sum
8. Combination Sum II
9. *Generate Parentheses
10. Letter Combinations of a Phone Number
11. *Subsets
12. N-Queens
Word Search
Nary Tree and Trie
1. Implement Trie
2. Map Sum Pairs
3. Replace Words
4. Add and Search Word
5. Implement Magic Dictionary
Design
1. Logger Rate Limiter
2. Trafic Rate Limiting
3. Hit Counter
4. Insert Delete GetRandom O(1)
5. LRU Cache
5. Design Uber
6. Implement Queue using Stacks
7. Implement Stacks using Queue
Hash Tables
1. Jewels and Stones
2. Find Anagram Mapping
Uber
Uber Onsite
Powered by
GitBook
4. Find Length
results matching "
"
No results matching "
"