Data Structures & Algorithms¶
Table of Contents
Don’t recall. You won’t remember it. Reason. Then you might.
Focus Areas¶
Linked-List, Bit-Manipulation, Stacks & Queues, Binary Search, Heaps, Greedy Algorithms, Dynamic Programming, Vectors/ArrayLists, Big O Time and Space, Sorting, Two Pointers, Sliding Window, Union-Find, String Manipulations, Trees and Graphs, BFS/DFS, Recursion, Back-Tracking, Hashing, Trie, Segment Trees & Binary Indexed Trees.
Core Porblem Solving Tricks¶
Attention
Binary Search
Prefix Sum
Two Pointers
Sliding Window
Divide & Conquer
Recursion & DP
Priority Queue
DFS/BFS
Core Algorithms & Data Structures¶
Binary Search: [Basic] Find Key, Bisect Left, Bisect Right, Both Ends, [Rotated] Find Min (distinct), Find Key (distinct), Find Key (not distinct)
Two pointers/Bookkeeping: Any Two Sum Pairs, All Two Sum Pairs, All Three Sum Triplets, 2 Way Partition (Quicksort), 3 Way Partition (Dutch National Flag)
Sort: Heap Sort, Merge Sort, Count Inversions
Stack: Using Queue
Queue: Circular, Using Stack, Circular Deque
Linked List: Cycle Detection, Reverse, Design
Tree: Binary Traversal (Preorder, Inorder, Postorder, Level-order, Vertical/Unordered, Vertical/Ordered), N-Ary Traversal (Preorder, Postorder, Level-order), LCA, Path Sum, Serialize (Binary Tree, N-Ary Tree) Reconstruct (Preorder and Inorder, Inorder and Postorder, Preorder and Postorder, Preorder, Descriptions, Number of Ways), Encode N-Ary to Binary
Binary Search Tree: Search, Insert, Delete, Balance, Threaded Binary Tree, Inorder Iterator, Validate BST, Serialize, LCA, Reconstruct (Preorder, Sorted List), Merge
DSU: TODO
Range Query Trees: Binary Indexed Tree/Fenwick Tree, Segment Tree, Cartesian Tree, Interval Tree
Monotonic Stack: Next Greater, Previous Greater, Both Ends (Rectangle in Histogram), All Subarray Mins)
Graph: BFS, Bidirectional BFS, Multi Source BFS, DFS, Cycle Detection (Undirected, Directed) Edge Classification, MST, SSSP, TSort, Articulation Vertices & Bridges, SCC
DP - Sequence: Counting Path 2 2D Array, LCS, LIS, LPS, 0-1 Knapsack: Bounded (Target Sum, Equal Sum Partition), Unbounded (Min Items Count, All Combination Count), Edit Distance, Maximal Square, Rod Cutting
Backtracking: Permutations, Permutation with Repetition, Combinations, Paranthesis, Subsets, Subsets with Repetition, Combination Sum Unbounded, Combination Sum Bounded
String: Hashing, Rolling Hash, Trie, Trie DFS, Trie Application
Resources¶
Fundamentals¶
Attention
[cp-algorithms.com] Algorithms for Competitive Programming
[usaco.guide] USACO Guide
[bigocheatsheet.com] Know Thy Complexities!
[walkccc.me] Solutions to Introduction to Algorithms Third Edition
Problem Patterns¶
Note
[thealgorists.com] Data Structures & Algorithms
[neetcode.io] Neetcode
[leetcode.com] Master DSA Patterns
[hellointerview.com] Data Structures and Algorithms
[deriveit.org] DeriveIt
Code Patterns¶
Note
[algo.monster] Templates
[github.io] LC cheatsheet
Mostly Useful¶
Important
[takeuforward.org] Strivers A2Z DSA Course/Sheet
[leetracer.com] Screen Questions - (Company Tags Last Updated: 11-02-24)
[github.com] LeetCode-Questions-CompanyWise
[leetcode.com] Top Google Questions
[leetcode.com] Top 100 Liked
[reddit.com] I passed Meta E6 Hiring Committee (Screen+FullLoop). My thoughts, advice, tips.
[reddit.com] 3 parts of mastering LC with SCC example
[reddit.com] Here’s a master list of problem keyword to algorithm patterns
Might be Useful¶
Note
[leetcode.com] Lessons from My Google L5 Interview Experience: Tips and suggestion
[leetcode.com] Google Onsite
[medium.com] META’s Most Asked Coding Interview Questions: The Complete List of 73 LeetCode Problems.
[docs.google] Leetcode Questions - public - solved by Siddhesh
[leetcodethehardway.com] LeetCode The Hard Way
[docs.google] DSA Resource Problem Set
[leetcode.com] 14 Patterns to Ace Any Coding Interview Question
[educative.io] Grokking the Coding Interview Patterns
[educative.io] 3 month coding interview preparation bootcamp
[educative.io] Data Structures for Coding Interviews in Python
[github.com] Grokking the Coding Interview Patterns for Coding Questions
[designgurus.io] Grokking the Coding Interview: Patterns for Coding Questions
[github.com] Tech Interview Handbook
[github.com] Interview_DS_Algo
[geeksforgeeks.org] Must Do Coding Questions for Companies
[geeksforgeeks.org] Must Do Coding Questions Company-wise
[interview-prep-pro.vercel.app] Interview Prep Pro
Topics¶
Binary Search¶
[leetcode.com] Powerful Ultimate Binary Search Template
Sliding Window¶
Important
[youtube.com] Sliding Window Mental Model
[leetcode.com] Sliding Window Technique: A Comprehensive Guide
[geeksforgeeks.org] Sliding Window Technique
[leetcode.com] Sliding window with frequency counts
[leetcode.com] Lee’s solutions for sliding window
Two Pointers¶
Important
[leetcode.com] Solved all two pointers problems in 100 days.
[reddit.com] Two-Pointer Technique, an In-Depth Guide