Month: March 2019

Working with ranges: Fenwick trees
Let’s talk about Fenwick trees(a.k.a. Binary Indexed Trees) for a moment and see how we can use them to solve range problems. This is not a tutorial, just a few notes for my future self. By the way, I already posted about this topic some time ago, this time, however, I’ll focus my attention on…

Working with intervals
Today I solved two problems on LeetCode that involved intervals(i.e., pairs of values of the form [start, end]) and I thought it would be a good idea to share a basic strategy that I know of for tackling these kinds of problems. So, intervals are not difficult to understand, the idea is actually quite intuitive,…

LRU cache
So, I was asked to implement an LRU cache a few years ago in an interview with Oracle, which I couldn’t quite solve on my own in O(1). Recently I found this problem on LeetCode and I can say this time it was not a big deal, here is my solution. I know, my tests…