Skip to content

AlexanderBlake/Data-Structures-and-Algorithms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Data Structures

๐Ÿ”ผ Back to top

Data Structure Code Search Insert/Delete Notes Language Support
Binary Search Tree JavaScript O(log n) O(log n) C++ (map / set) & Java (TreeMap / TreeSet)
Dyanmic Array / ArrayList Unsorted: O(n) / Sorted: O(log n) Last Value: O(1) / All other values: O(n) C++ (vector), C# (ArrayList), Java (ArrayList), JavaScript (Array), & Python (list)
Hash Map / Hash Set JavaScript O(1)* O(1)* Time Complexity is constant on an amortized basis (average) C++ (unordered_map / unordered_set), C# (Dictionary / Hashtable / HashSet), Java (HashMap / HashSet), JavaScript (Map* / Set*), & Python (dictionary / set)
Linked List JavaScript O(n) O(1)
Min / Max Heap (Priority Queue) O(n) O(log n) Find-min/max: O(1) C++ (algorithm / make_heap()), Java (PriorityQueue), & Python (heapq)
Queue JavaScript O(n) O(1) FIFO / LILO (First In First Out / Last In Last Out) C++ (queue / deque), C# (Queue), Java (ArrayDeque), & Python (deque)
Stack JavaScript O(n) O(1) FILO / LIFO (First In Last Out / Last In First Out) C++ (deque / vector / stack), C# (Stack / ArrayList), Java (ArrayDeque / ArrayList / Stack), JavaScript (Array), & Python (list / deque)

Leetcode Topic Roadmap

1. Arrays & Hashing

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
1. Two Sum Easy C++ JavaScript Python YouTube
36. Valid Sudoku Medium Python YouTube
41. First Missing Positive Hard Python TypeScript YouTube
49. Group Anagrams Medium Python YouTube
88. Merge Sorted Array Easy Python YouTube
205. Isomorphic Strings Easy Python YouTube
217. Contains Duplicate Easy C++ JavaScript Python YouTube
347. Top K Frequent Elements Medium Python YouTube
442. Find all Duplicates in an Array Medium Python YouTube
2482. Difference Between Ones and Zeros in Row and Column Medium Python YouTube

2. Two Pointers

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
11. Container With Most Water Medium Python YouTube
15. 3Sum Medium Python YouTube
26. Remove Duplicates from Sorted Array Easy JavaScript Python YouTube
27. Remove Element Easy Python YouTube
28. Find the Index of the First Occurence in a String Easy Python TypeScript YouTube
125. Valid Palindrome Easy C++ JavaScript Python YouTube
167. Two Sum II - Input Array Is Sorted Medium JavaScript Python YouTube
234. Palindrome Linked List Easy Python TypeScript YouTube
344. Reverse String Easy C++ JavaScript Python YouTube
2130. Maximum Twin Sum of a Linked List Medium Python YouTube

3. Stacks

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
20. Valid Parentheses Easy C++ JavaScript Python YouTube
22. Generate Parentheses Medium Python YouTube
94. Binary Tree Inorder Traversal Easy Python YouTube
150. Evaluate Reverse Polish Notation Medium Python YouTube
1047. Remove All Adjacent Duplicates In String Easy JavaScript Python YouTube
1209. Remove All Adjacent Duplicates In String II Medium Python YouTube
1614. Maximum Nesting Depth of the Parentheses Easy Python YouTube
2390. Removing Stars From a String Medium Python YouTube

4. Binary Search

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
34. Find First and Last Position of Element in Sorted Array Medium Python YouTube
35. Search Insert Position Easy Python YouTube
69. Sqrt(x) Easy C++ JavaScript Python YouTube
74. Search a 2D Matrix Medium Python YouTube
162. Find Peak Element Medium Python YouTube
222. Count Complete Tree Nodes Easy Python YouTube
349. Intersection of Two Arrays Easy Python YouTube
374. Guess Number Higher or Lower Easy JavaScript Python YouTube
700. Search in a Binary Search Tree Easy Python YouTube
704. Binary Search Easy JavaScript YouTube

5. Sliding Window

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
3. Longest Substring Without Repeating Characters Medium Python YouTube
121. Best Time to Buy and Sell Stock Easy JavaScript Python YouTube
643. Maximum Average Subarray I Easy Python YouTube
1456. Maximum Number of Vowels in a Substring of Given Length Medium Python YouTube
1658. Minimum Operations to Reduce X to Zero Medium Python YouTube

6. Linked List

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
2. Add Two Numbers Medium Python YouTube
19. Remove Nth Node From End of List Medium Python YouTube
21. Merge Two Sorted Lists Easy JavaScript Python YouTube
83. Remove Duplicates from Sorted List Easy JavaScript Python YouTube
116. Populating Next Right Pointers in Each Node Medium Python YouTube
141. Linked List Cycle Easy JavaScript Python YouTube
206. Reverse Linked List Easy Python TypeScript YouTube
237. Delete Node in a Linked List Medium C++ YouTube
287. Find the Duplicate Number Medium Python TypeScript YouTube

7. Trees

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
98. Validate Binary Search Tree Medium C++ YouTube
100. Same Tree Easy C++ JavaScript Python YouTube
102. Binary Tree Level Order Traversal Medium C++ Python YouTube
103. Binary Tree Zigzag Level Order Traversal Medium Python YouTube
104. Maximum Depth of Binary Tree Easy C++ JavaScript YouTube
112. Path Sum Easy Python YouTube
230. Kth Smallest Element in a BST Medium Python YouTube
863. All Nodes Distance K in Binary Tree Medium Java Python YouTube
1038. Binary Search Tree to Greater Sum Tree Medium C++ YouTube
1302. Deepest Leaves Sum Medium C++ JavaScript YouTube

8. Design

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
146. LRU Cache Medium Python YouTube
155. Min Stack Medium C++ Python YouTube
303. Range Sum Query - Immutable Easy Python YouTube
380. Insert Delete GetRandom O(1) Medium C++ Python TypeScript YouTube
535. Encode and Decode TinyURL Medium Python YouTube
703. Kth Largest Element in a Stream Easy Python YouTube
933. Number of Recent Calls Easy Python YouTube
1603. Design Parking System Easy C++ YouTube

9. Tries

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
14. Longest Common Prefix Easy Python YouTube

10. Backtracking

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
17. Letter Combinations of a Phone Number Medium Python YouTube
46. Permutations Medium Python YouTube
77. Combinations Medium Python YouTube
78. Subsets Medium Python YouTube

11. Heap / Priority Queue

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
215. Kth Largest Element in an Array Medium Python YouTube
973. K Closest Points to Origin Medium Python YouTube

12. Graphs

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
127. Word Ladder Hard Python YouTube
200. Number of Islands Medium Java JavaScript Python YouTube
207. Course Schedule Medium Python YouTube
399. Evaluate Divison Medium Python YouTube
695. Max Area of Island Medium Java Python YouTube

13. 1-D Dynamic Programming

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
5. Longest Palindromic Substring Medium Python YouTube
32. Longest Valid Parentheses Hard Python YouTube
70. Climbing Stairs Easy JavaScript YouTube
322. Coin Change Medium Python TypeScript YouTube
392. Is Subsequence Easy Python YouTube
746. Min Cost Climbing Stairs Easy Python YouTube

14. Intervals

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
56. Merge Intervals Medium Python YouTube

15. Greedy

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
53. Maximum Subarray Medium C++ JavaScript Python YouTube
122. Best Time to Buy and Sell Stock II Medium JavaScript Python YouTube
134. Gas Station Medium Python YouTube
680. Valid Palindrome II Easy Python YouTube
1802. Maximum Value at a Given Index in a Bounded Array Medium Python YouTube
2405. Optimal Partition of String Medium C++ Python YouTube
2571. Minimum Operations to Reduce an Integer to 0 Medium Python YouTube

16. Advanced Graphs

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
1584. Min Cost to Connect All Points Medium Python YouTube

17. 2-D Dynamic Programming

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
62. Unique Paths Medium Python YouTube
64. Minimum Path Sum Medium Python YouTube

18. Bit Manipulation

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
7. Reverse Integer Medium Python YouTube
67. Add Binary Easy Python YouTube
136. Single Number Easy C# JavaScript Python YouTube
190. Reverse Bits Easy Python YouTube
191. Number of 1 Bits Easy Python YouTube
268. Missing Number Easy Python YouTube
338. Counting Bits Easy Python YouTube
2433. Find The Original Array of Prefix Xor Medium Python YouTube

19. Math & Geometry

๐Ÿ”ผ Back to top

Problem Difficulty Code Solution Video Solution
9. Palindrome Number Easy C++ YouTube
13. Roman to Integer Easy C++ Java JavaScript YouTube
48. Rotate Image Medium Python YouTube
66. Plus One Easy Python YouTube
73. Set Matrix Zeroes Medium Python YouTube
202. Happy Number Easy JavaScript Python YouTube
258. Add Digits Easy JavaScript Python YouTube
412. Fizz Buzz Easy C++ Java JavaScript Python TypeScript YouTube
509. Fibonacci Number Easy C++ JavaScript YouTube
1492. The kth Factor of n Medium Python YouTube

Resources

๐Ÿ”ผ Back to top

Website Description
Pramp Free Interview Practice
GitHub Skill Assessment Quizzes
UNLV Resume and Interview Tips
Levels.fyi Compensation Information