Introduction When I’m at work I frequently encounter situations that could be quite messy. I was working on developing a supporting tool recently, that contained a Python Django-based app and another jar file that had to be invoked and sends the output to the Django app for the web dashboard to display the .jar file …

We learned in the last post about possible ways of implementing a priority queue data type. In this part, we’re going to talk about representing a heap internally. We create a private array pq[] of length N+1. Our array will be 1-indexed. Implementation and algorithms Heapifying As we have seen in the previous parts, for …

Priority Queues part III: Implementation and Algorithms

We learned in the last post about possible ways of implementing a priority queue data type. In this part, we’re going to talk about representing a heap internally. We create a private array pq[] of length N+1. Our array will be 1-indexed. Implementation and algorithms Heapifying As we have seen in the previous parts, for …

Brief In the previous part, we talked about the theory and motivation for priority queues. In this part, we dive a little bit into the implementation. We will see possible implementations of a priority queue, especially heap implementation, and in the next part of the series we will have a look at the Java implementation. Implementation …

Priority Queues Part II: Heap Implementation in Java

Brief In the previous part, we talked about the theory and motivation for priority queues. In this part, we dive a little bit into the implementation. We will see possible implementations of a priority queue, especially heap implementation, and in the next part of the series we will have a look at the Java implementation. Implementation …

Imagine that you have a big log of financial transactions and you want to extract the largest 5 transactions that happened. We might have a few ways to approach this. 1. Sort them? Duh. If we have 3 million transactions, let’s say, on a span of month. We will have to do the following: Store …

Hello. Thought I’d make it a habit by writing (hopefully) weekly on some coding challenge I work on in my free time. So, welcome to the second article :). Today’s challenge is not actually that much different than the previous one (well, it is different, but not that different). Let’s take a look at Maximum Binary Tree challenge on LeetCode. The …

Maximum Binary Tree — LeetCode #654

Hello. Thought I’d make it a habit by writing (hopefully) weekly on some coding challenge I work on in my free time. So, welcome to the second article :). Today’s challenge is not actually that much different than the previous one (well, it is different, but not that different). Let’s take a look at Maximum Binary Tree challenge on LeetCode. The …

Hello, world. I have been brushing up on algorithms and data structures and a big part of what I do is working on solving some LeetCode and HackerRank challenges. I wanted to stay in the ready-for-interview mode for sometime. Who knows when an opportunity may come! I encountered this problem: Keys and Rooms. Despite not solving many challenges related to …

Keys and Rooms — LeetCode Coding Challenge

Hello, world. I have been brushing up on algorithms and data structures and a big part of what I do is working on solving some LeetCode and HackerRank challenges. I wanted to stay in the ready-for-interview mode for sometime. Who knows when an opportunity may come! I encountered this problem: Keys and Rooms. Despite not solving many challenges related to …