Subroutine Logo
Subroutine
Subroutine CS // Interactive Computer Science Blog

Subroutine CS: Master Programming
Through Sound & Visual Intuition

Welcome to Subroutine CS (subroutine-cs.cc) - an interactive educational blog covering algorithms, low-level systems optimization, C++, neural networks, and computer architecture.

Educational Articles

Written in MDX with embedded audio-visual simulators

Showing 44 of 44 Article(s)
Physics & Math
11 min readAdvanced

The Crank-Nicolson Method: Unconditionally Stable PDE Integration

Solving parabolic partial differential equations with second-order temporal accuracy, implicit finite-difference discretization, and tridiagonal matrix solvers.

2026-09-07Read Article
Networking
10 min readAdvanced

eBPF & XDP: Programmable Line-Rate Packet Processing in the Linux Kernel

How eBPF and eXpress Data Path (XDP) execute sandboxed bytecode directly in the network driver layer, bypassing sk_buff allocation for 100Gbps packet filtering.

2026-09-07Read Article
Web3 & Crypto
10 min readAdvanced

The EVM Execution Pipeline: Stack Mechanics, Gas Scheduling & Transient Storage

How the Ethereum Virtual Machine executes 256-bit word bytecode, dynamically calculates gas costs, manages persistent vs transient storage (EIP-1153), and enforces reentrancy protection.

2026-09-07Read Article
AI & ML
10 min readAdvanced

PagedAttention & KV-Cache Management in High-Throughput LLM Serving

Eliminating GPU memory fragmentation in large language model inference using virtual memory paging principles, non-contiguous block tables, and copy-on-write.

2026-09-07Read Article
Security
7 min readAdvanced

Post-Quantum Cryptography: Lattice-Based Key Encapsulation with ML-KEM

Transitioning public-key infrastructure away from RSA and elliptic curves toward NIST FIPS 203 Module-LWE lattices to protect against future quantum adversaries.

2026-09-07Read Article
Networking
10 min readIntermediate

QUIC and HTTP/3: Eliminating Head-of-Line Blocking Over UDP

Why multi-stream TCP connections stall on single-packet drops, and how QUIC moves transport layer flow control into userspace with per-stream loss isolation and 0-RTT.

2026-09-07Read Article
Languages
8 min readAdvanced

Rust Pin and Unpin: Self-Referential Structs & Async State Machines

Deconstructing why compiler-generated async futures require memory pinning, how pointer movement invalidates self-references, and the safety contract of Pin.

2026-09-07Read Article
Web3 & Crypto
10 min readAdvanced

Solana Sealevel: Parallel Transaction Scheduling & Account-Based Execution

How Solana overcomes single-threaded blockchain bottlenecks via explicit account read/write declarations, non-overlapping DAG scheduling across multi-core CPUs, and eBPF bytecode JIT compilation.

2026-09-07Read Article
Page 1 of 6

Featured Interactive Visualizer

Live Web Audio API & HTML5 Canvas Simulation

Read Full Article →

Quick Sort

Avg: O(N log N)Space: O(log N)

Picks a pivot element and partitions the surrounding array into elements smaller and larger than the pivot recursively.

Size:32
Speed:40ms
Compares: 0
Swaps: 0
Implementation Code for Quick Sort
quick_sort.cpp
C++
template <typename T>
int partition(std::vector<T>& arr, int low, int high) {
    T pivot = arr[high];
    int i = low - 1;
    for (int j = low; j < high; j++) {
        if (arr[j] < pivot) {
            i++;
            std::swap(arr[i], arr[j]);
        }
    }
    std::swap(arr[i + 1], arr[high]);
    return i + 1;
}

template <typename T>
void quickSort(std::vector<T>& arr, int low, int high) {
    if (low < high) {
        int p = partition(arr, low, high);
        quickSort(arr, low, p - 1);
        quickSort(arr, p + 1, high);
    }
}