Java Static Keyword

Static keyword in Java is used mainly for memory management, that’s why I think is necessary to have a picture of how memory is assigned to a program in front of us. I borrowed this from mycodeschool’s youtube video. This is over-simplification. In reality, JVM (Java Virtual Machine) which loads and executes Java bytecode on

Read More

Red Black Tree

This is a quick-reference guide to Red Black Tree data structure based on Introduction to Algorithms (3rd ed) by T. Cormen, et al. Implemented code is written in Java.Red Black Tree is a self-balancing binary search tree with following properties: Every node is either red or black Root is always black (nil nodes are black

Read More

Java Lambda Expressions Quick Reference

Java Lambda Expression facilitates functional programming in a way that it lets you treat method (function) as an object that can be passed around and executed on demand. Java lambda expression does not belong to any class, but it lets you express instances of single method classes more compactly. Java lambda expressions are used to

Read More

Floyd-Warshall With Example

Floyd-Warshall algorithm is used for solving All Pairs Shortest Path problem, i.e. finding shortest path between all pairs of vertices with negative edges allowed. Dijsktra and Bellman-Ford (negative edges allowed), other known graph algorithms, are used for finding shortest path from one vertex to all the others. Logic behind Floyd-Warshall is straight-forward. For each pair

Read More

Guide to Solving Problems Using Dynamic Programming

Dynamic Programming is a technique that seems hard to get a grasp on at first, but once you understand the idea behind it, it becomes clear and even simple. Below is my 4-steps approach explained on a classical Longest Increasing Subsequence problem. Problem description1: Find the longest increasing subsequence of a given sequence. Input: Array

Read More

Coding Challenges Logo

Weather Observation Station Challenges

There are a total of 20 queries and each one is performed on the STATION table:             Query 1: Query a list of CITY and STATE from the STATION table. Solution: SELECT city, state FROM station; Query 2: Query the following two values from the STATION table: The sum of

Read More

DRad’est HIIT Timer

Every period of human history has its own characteristics, unique ways it contributes to the advancement of humanity and the challenges it has to face. Taking care of one’s health has gained in popularity in the last decade or so. There are many ways one can improve his own fitness and health. In this day

Read More

Exploring Android Material Design Components

Android Design Support Library (awesome blogpost) offers so many features, I want to explore them in these series of exercises. The repository for this exercise can be found on GitHub here. Before we start, we need to add the gradle dependency for Design Support Library to our app build.grade (app level): dependencies { … compile

Read More