A personal study laboratory — one repository for everything I'm working through, across languages and formats. It currently holds a from-scratch data structures & algorithms track in Java (interview and research-engineering preparation) and a machine-learning / statistics track in Python (book labs and experiments); planned areas include probability (Harvard Stat 110), LeetCode / NeetCode 150 practice, and further ML coursework — all under the same roof, same conventions, same notes discipline. Everything is written by hand, documented in prose notes, and validated (Java: self-contained test runners; Python: executable notebooks). The work is paced and deliberate: the goal is durable understanding, not just passing tests.
Data_structures/— generic structures plus shared types (Graphinterface, both graph representations,Tree_node), each in its own file with a<Name>_Maintest runner.Algorithms/— reusable algorithms that build on those structures: suffix-array string algorithms, merge sort, graph traversals, tree algorithms, shortest paths, topological sorts, SCC, MST, Eulerian paths, and four max-flow implementations. Same per-file test-runner pattern.Problems/— specific named problems and exercises: the recursion/divide-and-conquer exercises, tilings, knapsacks, Kattis problems, Held-Karp TSP, grid shortest path, and the Mice-and-Owls bipartite-flow problem. The rule of thumb separating the two code packages:Algorithms/holds reusable procedures another file might import;Problems/holds leaf files that answer one specific question.Machine_learning/— the machine-learning / math track (Python): topic folders holding book labs and my own experiments, plus the shared conda environment spec. Organized by topic, not by book — every book feeds the same tree (seeMachine_learning/layout below).Data_structures_notes.md,Algorithms_notes.md,Problems_notes.md,ML_notes.md— prose notes, one file per area (see the topic index).- Planned areas (same pattern — a root folder + a root notes file each):
probability/for Stat 110,leetcode/for NeetCode-150 / LeetCode practice. Images/— figures referenced by the notes.Makefile— root build/run harness for all three packages.
One notes file per package — a class's note is always in the file matching its folder:
| File | Covers |
|---|---|
Data_structures_notes.md |
Arrays, linked lists, stack/queue, heap & priority queues, union-find, BST & AVL, hash tables, Fenwick tree, suffix array, indexed PQ, sparse table, and both graph representations (adjacency matrix & list) |
Algorithms_notes.md |
Suffix-array string algorithms (unique substrings, LRS, LCS), divide & conquer + merge sort, graphs overview, DFS/BFS, tree algorithms (rooting, leaf sum, center, isomorphism, LCA), topological sorts, DAG paths, Dijkstra, Bellman-Ford, Floyd-Warshall, Tarjan SCC, Eulerian path, Prim, and the four max-flow algorithms |
Problems_notes.md |
Recursion/D&C exercises (multiplication, list sum, string reversal, max-2D, three-way min), DP problems (magical cows, tilings, mountain scenes, narrow art gallery, knapsacks), grid shortest path, Held-Karp TSP, and bipartite matching via max flow (Mice and Owls, Elementary Math) |
ML_notes.md |
The ML/statistics track, built topic by topic from book/video highlights (ISL, Hands-On ML, Karpathy Zero to Hero, Designing ML Systems). Concept notes in Definition / Intuition / Notes format, grouped by topic |
The ML track lives beside the Java packages, in Python, organized by topic — never per book (books come and go; topics accumulate). Each topic folder holds book labs and my own experiments, distinguished by filename prefix:
Machine_learning/
environment.yml # the shared conda env spec (see Conda_setup_mac.md)
data/ # datasets (large files gitignored)
linear-regression/ # islp_lab_ch03.ipynb, exp_gradient_descent.py, ...
classification/ # logistic regression, LDA/QDA, naive Bayes, KNN
resampling/ # cross-validation, bootstrap
regularization/ # ridge, lasso, PCR/PLS, model selection
nonlinear/ # polynomials, splines, GAMs
trees/ # decision trees, bagging, random forests, boosting
svm/
deep-learning/ # ISL ch10 labs now; Karpathy/Géron material later
survival/ # censored data, survival curves
unsupervised/ # PCA, clustering
inference/ # multiple testing; Stat 110 probability work later
Naming convention inside a topic folder: <source>_<what>.ipynb|py — e.g. islp_lab_ch08.ipynb (a book lab, kept close to the book's version), exp_tree_depth_sweep.py (my own experiment). One conda environment (ml) serves the whole tree; per-topic environments only if a book genuinely conflicts (deep-learning may eventually get its own for torch pinning).
Notes for all of it go in the single ML_notes.md at the root — same one-notes-file-per-area rule as the Java packages — built chapter by chapter via the handoff workflow in ML_handoff.md.
Every Java class follows the same rules so the codebase reads consistently (the Machine_learning/ area follows the lighter Python conventions above instead):
- Generic backing via
Object[]with@SuppressWarnings("unchecked")casts on read (Java erasure rules outnew E[n]). Numeric-only structures (e.g.Fenwick_tree) use a primitive backing likelong[]instead. - Contract-only comments above each method — what it does, returns, and throws — with no implementation hints, so the method body is the exercise.
- Self-contained test runner: each file declares a
<Name>_Mainclass withcheckEquals,checkTrue, andcheckThrowshelpers that print PASS/FAIL inline, tally results, print a summary, andSystem.exit(1)on any failure. Tests cover edge cases (empty, single element, bounds, null-safety) and, where useful, cross-check against a brute-force reference; test constants are verified against an independent method before being trusted. - Null-safety with
java.util.Objects.equalsfor value comparisons. - Structure-specific touches, e.g. doubly linked lists carry a
toStringReversethat walksprevpointers to verify back-pointer maintenance.
Requires a JDK for the Java packages (developed and tested on JDK 21; a fresh container needs apt-get install -y default-jdk-headless) and the ml conda environment for notebooks. make setup checks the toolchain and builds the environment for you (install Miniforge first — see Conda_setup_mac.md). One root Makefile drives everything:
make setup # verify javac/python3/conda (error if missing),
# then create or update the ml conda env and
# register its Jupyter kernel
make run F=Stack # compile all Java, run Data_structures.Stack_Main, clean
make run F=Magical_cows # package auto-detected (Problems here)
make run-nb N=islp_lab_ch03 # execute a notebook top-to-bottom in place
# (bare name is found under Machine_learning/; a path works too)
make run-latest # run the most recently modified source anywhere:
# .java -> its _Main, .ipynb -> execute it,
# Machine_learning/ .py -> run it in the ml env
make run-all # run every Java *_Main AND execute every notebook
# under Machine_learning/, log to test-results.log,
# print only failures (notebooks skipped with a
# notice if conda/jupyter isn't installed)
make list # list runnable classes and notebooks, newest first
make clean # delete .class files, .ipynb_checkpoints, and
# generated artifacts under Machine_learning/ (pngs, exports,
# csv dumps outside Machine_learning/data/ — protected types:
# .ipynb .py .yml .yaml .md and all of Machine_learning/data/)
make clean-all # clean + strip output cells from every notebook
# (run before committing notebooks)make run picks the Java package automatically based on which folder contains <F>.java, then auto-cleans the generated .class files. Interface/type files with no _Main are skipped by run-all automatically. Notebook execution and output-stripping use the ml conda env when conda is on the machine (conda run -n ml), falling back to whatever jupyter is on PATH.
For interactive work in Machine_learning/: conda activate ml, then jupyter lab from the repo root. Setup instructions: Conda_setup_mac.md.
Data-structure notes use a three-part template — Positives / Negatives / Algorithm (thought process) — and algorithm/problem notes use Idea / Complexity / Notes. ML concept notes use Definition / Intuition / Notes (terms get a crisp definition, a plain-language why-it-matters, then caveats and connections). Notes live in root-level files mirroring the areas, each with a grouped table of contents. Complexity claims describe this repo's implementations; faster textbook variants are noted as upgrades. Where an implementation has a known deviation or bug, the note carries a Code flag line pointing at the reconciliation report.
Claude (Anthropic) is used as a coding tutor and scaffolding tool, not as a code generator that does the work:
- Skeletons. Claude produces the class scaffold — fields, contract-only method stubs, and a complete
<Name>_Maintest runner (known-answer cases plus brute-force cross-checks) — matching the conventions above. The method bodies are left empty for me to implement. - Socratic debugging. When I share buggy code, Claude points at the bug and walks the failing trace, edge cases, and complexity trade-offs rather than handing over a fix. It only writes the fix when I explicitly ask.
- Notes. Claude converts my handwritten notes into the templates above, flagging and correcting errors rather than copying them verbatim, and periodically reconciles the notes against the implemented code (the code is the source of truth).
The intent is that the learning happens while filling in the skeletons and chasing down the test failures; the scaffolding just removes boilerplate and keeps the structure uniform.
Listed by title only (links move over time and are easy to find by name). Checked = completed.
- William Fiset — Data Structures (YouTube)
- William Fiset — Graph Theory (YouTube)
- William Fiset — Algorithms (companion Java repo)
- Abdul Bari — Algorithms (YouTube)
- Grokking the Coding Interview (pattern-based prep)
- Cracking the Coding Interview
- NeetCode 150
- Introduction to Statistical Learning (ISL / ISLP)
- Andrej Karpathy — Neural Networks: Zero to Hero
- Aurélien Géron — Hands-On Machine Learning (ch. 10–16)
- Chip Huyen — Designing Machine Learning Systems (Stanford CS329S)
- StatQuest (Josh Starmer) — videos
- Ian Goodfellow et al. — Deep Learning
- Ron Kohavi et al. — Trustworthy Online Controlled Experiments
- Harvard Stat 110 — Probability (Joe Blitzstein) — ch. 1–4 & 6–8
- 3Blue1Brown — Essence of Linear Algebra
- 3Blue1Brown — Essence of Calculus
- 3Blue1Brown — Differential Equations
- Sebastian Raschka — Build a Large Language Model (From Scratch) (Manning, 2024)
- Stanford CS336 — Language Modeling from Scratch
- Sebastian Raschka — Build a Reasoning Model (From Scratch) (Manning, 2026)
- Khang Pham — Machine Learning Interviews (late-stage drilling)
Environment: macOS, zsh. Resources are listed by title only — no links, since course and book pages move over time; search by title to find the current source.
BSD 2-Clause — see LICENSE. Chosen to match the license of the ISLP package this repo's ML labs build on, so my code and the upstream lab code sit under compatible terms. Note that any ISLP lab files copied into Machine_learning/ remain © their original authors under their own BSD-2-Clause notice — keep upstream headers intact on copied files; this repo's license covers my own code and notes.
- fixing this readme to be more general
- convert md files to well formed latex files as they support addinional functions
- create notaion cheatsheet on the side
- git submodule udpate code - git submodule update --remote neetcode