Recent Posts

TIW: Subset Sum

6 minute read

Subset sum, aka the coin change problem, is a very specific problem that for some reason gets mentioned a lot. The problem is very simple: given some coins o...

Brief Intro to Segment Tree

12 minute read

Something I just learned - segment tree, is a data structure more advanced and generalized than binary indexed tree. Even though I just learned it and might ...

Tinkering with Deep Learning Style Transfer

10 minute read

A while ago, Prisma was quite popular on social media and everyone was filtering pictures with its artistic filters. Got some free time yesterday, so I thoug...

TIW: Binary Indexed Tree

11 minute read

Binary indexed tree, also called Fenwick tree, is a pretty advanced data structure for a specific use. Recall the range sum post: binary indexed tree is used...

TIW: Bitwise

7 minute read

Bitwise operations are black magic. It is so simple but with them you can do things that you never thought would be so easy. For those who have never seen th...

TIW: Linked List Cycle

4 minute read

This is more like a special topics post, because it is a very specific algorithm with a very narrow application. The problem statement: given a linked list w...

TIW: Reverse Linked List

4 minute read

A linked list is an array that supports O(1) insertion and O(n) random access, in contrast to vector’s O(n) insertion and O(1) random access. Here’s how a li...

TIW: Dijkstra

4 minute read

Shortest path problems using Dijkstra are actually very easy to write. There is a fixed format and you just need to fill in the blanks. The format: