Computer Science Cheatsheets
This collection contains comprehensive cheatsheets covering all major computer science topics and algorithmic patterns essential for coding interviews and software development.
📊 Data Structures
Topic |
Description |
Link |
Arrays |
Array operations, techniques, and patterns |
View |
Binary Trees |
Tree traversal, construction, and manipulation |
View |
Binary Search Trees |
BST operations and balancing |
View |
Graphs |
Graph algorithms, traversal, and analysis |
View |
Hash Maps |
Hashing techniques and collision handling |
View |
Heaps |
Priority queues and heap operations |
View |
Linked Lists |
List operations and pointer manipulation |
View |
🔍 Algorithm Patterns
Pattern |
Description |
Link |
Two Pointers |
Efficient array and string processing |
View |
Binary Search |
Efficient searching in sorted data |
View |
Sliding Window |
Subarray and substring problems |
View |
Backtracking |
Recursive problem solving |
View |
Dynamic Programming |
Optimization and memoization |
View |
Greedy Algorithms |
Local optimization strategies |
View |
🌐 Graph Algorithms
Algorithm |
Description |
Link |
BFS (Breadth-First Search) |
Level-order traversal and shortest paths |
View |
DFS (Depth-First Search) |
Deep exploration and connectivity |
View |
Dijkstra’s Algorithm |
Single-source shortest paths |
View |
Topological Sort |
Dependency resolution and ordering |
View |
⚡ Advanced Topics
Topic |
Description |
Link |
Bit Manipulation |
Bitwise operations and tricks |
View |
System Design |
Scalability and architecture patterns |
View |
Intervals |
Interval merging and scheduling |
View |
Math & Geometry |
Mathematical algorithms and computations |
View |
💡 Problem-Solving Techniques
Technique |
Description |
Link |
Pattern Recognition |
Common problem patterns and templates |
View |
Code Templates |
Reusable code patterns and structures |
View |
Java Tricks |
Language-specific optimizations |
View |
Python Tricks |
Python-specific techniques |
View |
📋 Quick Reference
Time & Space Complexity Guide
- O(1) - Constant time operations
- O(log n) - Binary search, balanced trees
- O(n) - Linear traversal, single pass
- O(n log n) - Efficient sorting, divide & conquer
- O(n²) - Nested loops, brute force
- O(2ⁿ) - Exponential, recursive backtracking
Common Data Structure Operations
Structure |
Access |
Search |
Insertion |
Deletion |
Space |
Array |
O(1) |
O(n) |
O(n) |
O(n) |
O(n) |
Dynamic Array |
O(1) |
O(n) |
O(1)* |
O(n) |
O(n) |
Hash Table |
N/A |
O(1)* |
O(1)* |
O(1)* |
O(n) |
Binary Tree |
O(log n)* |
O(log n)* |
O(log n)* |
O(log n)* |
O(n) |
*Average case performance
All cheatsheets are continuously updated with the latest patterns and techniques used in top-tier tech companies.