cs-core

Implementing a Binary Search Tree Iterator in 2026: A Practical, Iterative Approach

Most of the systems I build that rely on ordered data eventually run into a small but annoying problem: I want sorted output without paying the cost of materializing the whole tree. If I store results in a BST for fast inserts, recursion-based traversal works, but it is awkward when I need to pause, resume,

Implementing a Binary Search Tree Iterator in 2026: A Practical, Iterative Approach Read More »

Function Overloading in Programming: A Practical, Modern Guide

A few years ago I inherited a payments SDK where every formatting variation had a different name: formatMoneyInt, formatMoneyDecimal, formatMoneyWithCurrency, formatMoneyWithLocale. The code worked, but every caller had to memorize the naming grid, and new variants kept piling on. The core idea was a single action—formatting money—yet the API spoke in four dialects. That kind

Function Overloading in Programming: A Practical, Modern Guide Read More »

Finding the MEX of Every Subtree in a Tree: A Practical, Scalable Guide

Last quarter I was building a permissions feature for a product taxonomy. Each category node carried an integer label that came from a legacy sync, and for every category I needed the smallest missing non‑negative label inside its subtree. That number became the next safe ID for automated inserts. Doing this once is easy; doing

Finding the MEX of Every Subtree in a Tree: A Practical, Scalable Guide Read More »

Scroll to Top