Community is live · 2,341 notes published this week

Every CS Concept. Explained by Students Who Actually Get It.

Crowd-sourced study guides, annotated lecture breakdowns, and exam-prep cheat sheets — written by students who just survived the same course you're in right now.

~/compile $

Try: "merge sort" · "deadlock" · "NFA to DFA" · "SQL joins"

scroll to explore
RecursionData Structures · CS 201
"Why does my recursive function never hit the base case?"

— posted at 2:14 a.m. by a sophomore in CS 201

The Call Stack Doesn't Lie

Walk the execution frame by frame. The answer is always in what you passed.

Read the full guide
factorial.py
✗ broken
def factorial(n):
    # ← no base case!
    return n * factorial(n - 1)
✓ fixed
def factorial(n):
    if n == 0:  # ← base case
        return 1
    return n * factorial(n - 1)
Every recursive function needs two things: a base case (when to stop) and progress toward it. If n never reaches 0, the stack overflows. Always ask: "what shrinks?"

call stack · factorial(3)

3factorial(0) → 1
2factorial(1) → 1×1
1factorial(2) → 2×1
0factorial(3) → 3×2
AlgorithmsAlgorithm Design · CS 330
"How do I actually think through Big-O? I can write the code, I just can't see the complexity."

— bootcamp switcher, 3 weeks into algorithms

Stop Counting Operations. Count Growth.

Big-O is a claim about how your runtime behaves as input grows toward infinity — not a stopwatch.

Read the full guide

complexity · growth as n → ∞

O(1)Constant
array[i]
O(log n)Logarithmic
binary search
O(n)Linear
single loop
O(n log n)Linearithmic
merge sort
O(n²)Quadratic
nested loops
O(2ⁿ)Exponential
naive fibonacci

The key insight: Drop constants and lower-order terms. O(3n² + 2n + 7) is just O(n²). You're describing shape, not exact value.

When you see nested loops, think O(n²). When you see halving (binary search, divide-and-conquer), think O(log n). Pattern recognition beats formula memorization every time.
Operating SystemsOperating Systems · CS 440
"What's the actual difference between a process and a thread? My prof said they share memory but I don't get what that means."

— junior who skipped the first two OS lectures

One House, Different Rooms

A process is an isolated house. Threads are roommates — same address, different stacks.

Read the full guide

memory layout · process vs threads

process A

Stack A
Heap A
Code A

process B (2 threads)

Stack T1
Stack T2
Shared Heap
Shared Code

Why it matters for bugs: Two threads writing to the same heap address without a lock = race condition. Two processes writing to their own heap = fine. Isolation is the difference.

threads.c · race condition example
int counter = 0;  // shared heap

// Thread 1 and Thread 2 both run:
counter++; // NOT atomic! read → add → write
// Expected: 2  |  Actual: sometimes 1
Fix: wrap with a mutex (lock). Threads share memory for speed — but sharing without coordination = chaos.

by the numbers · updated live

14,200+

study notes published

3,800+

students enrolled

92

courses covered

340+

contributors this month

4.9★

avg. note rating

2 a.m.

most active hour

Binary Trees·Dynamic Programming·TCP/IP·Merge Sort·Deadlock·Turing Machines·SQL Joins·Dijkstra's·NP-Completeness·Hash Tables·Semaphores·Context Switching·Regex·B-Trees·MapReduce·Binary Trees·Dynamic Programming·TCP/IP·Merge Sort·Deadlock·Turing Machines·SQL Joins·Dijkstra's·NP-Completeness·Hash Tables·Semaphores·Context Switching·Regex·B-Trees·MapReduce·
weekly sessions · every thursday 8pm ET

Join the study group.
We saved you a seat.

This week's session: Graph Algorithms Deep Dive — BFS, DFS, Dijkstra's, and why Prim's and Kruskal's are more similar than your prof let on.

Free to join · No credit card · Zoom link sent immediately

"Passed my OS midterm with Compile's notes"

Amara O., MIT

"Finally understand Big-O after 3 semesters"

Devraj S., Waterloo

"The recursion guide saved my final project"

Caitlin M., UT Austin