# Monthly Archives: April 2019

## Median Of Two Sorted Arrays problem

This is a tricky little leetcode problem:https://leetcode.com/problems/median-of-two-sorted-arrays/ Here are some of my observations on a whiteboard: There are a lot of fiddly edge cases. I think my solution could be simplified but here is the gist anyway: https://gist.github.com/adamkorg/ffba283f298e7c2c2b748acb49ccc9f1

## Shortest Path – Dijkstra’s algorithm

Here are my whiteboard notes on how to implement the Dijkstra’s algorithm to find the shortest path of a graph: Here is my simple c++ implementation of this: The above is a very simple implementation of the algorithm. It is … Continue reading

## Shortest Path – Bellman Ford algorithm

Here are my notes on how to implement the Bellman Ford algorithm to find the shortest path of a graph: This is along the lines of what Rob Conery describes in The Imposter’s Handbook. And here is my c++ implementation … Continue reading

## Fibonacci spiral

Here are my whiteboard plans for drawing the Fibonacci spiral. The main issues were figuring out the x and y positions of each of the squares. I knew that I would need a loop that iterates around North, West, South … Continue reading

## Maximum Subarray Sum problem

I had to write down an example and work through it to figure this out. Here are my resulting whiteboard notes: A few different implementations can be found here: https://hackernoon.com/kadanes-algorithm-explained-50316f4fd8a6 I think Kadane’s algorithm can also be used to solve … Continue reading