Creativity, Teaching & Engineering

A technical blog sharing programming insights, math exploration, creative learning, and AI-powered education.

Programming Tutorials

Learn algorithms, data structures, and clean problem-solving strategies.

Math & IA Models

Explore creative IB Math IA, calculus models, voting theory, and real-world applications.

Teaching & Blog Writing

Sharing teaching experiences, educational tools, and creative learning methods.

Latest Articles

  • Disjoint Set Union

    The Disjoint Set Union (DSU) is a data structure used to store disjoint sets. Two sets are considered disjoint if they don’t have any elements in common.  The DSU supports mainly the following operations: This data structure will allow you to do such operations in around O(1) time complexity, and also allow you to store…

  • Fenwick Tree

    A fenwick tree is a compact data structure that allows to perform point/range queries as well as updates.  Define low(i) to be the value of the rightmost 1 bit in the base2 representation of i.  For example low(10) = 2 since 10 is 1010 in base 2 and the rightmost 1 has value 2.  low(24)…

  • Lazy Segment Tree

    Before in a segment tree, we could only perform range query and point update. What if we wanted to perform range update and range queries? Naively looping over every index and updating it would cause O(NlogN) time complexity per query, which is far too slow. Instead we need to use a lazy segment tree.  To…

  • Mo’s Algorithm

    Mo’s algorithm is a SQRT based algorithm that solves problems of the following form: Given a static array A of length N, answer Q queries of the form [l, r]. Asking for some query on the subarray from l to r. It could be anything from finding the sum, to finding the 3rd smallest integer…

  • Persistent Segment Tree

    Normally a segment tree can perform the following operations: Now, we will introduce more operations: Naively creating copies of our segment tree will result in both high time complexity and memory complexity. Hence, we need to find a smarter way to make copies. 

  • Prefix Sums

    Prefix Sum arrays are one of the most commonly used data structures in competitive programming.  The basic question is this: Given an array A that won’t change, we want to answer Q queries of the form [l,r] asking for the sum of A[l] + A[l+1] … A[r]. Naively solving this problem by iterating from l…

A Little About Me

I teach, write, and explore math models, creative coding, and algorithm thinking. My passion lies in using technology to inspire learning.