Book: “The 5 AM Club”

I recently completed listening to an audio-book version of the book “The 5 AM Club” by Robin Sharma. This, I would say for me is more of an inspiring book than a self-help one. The narrative of this book was unlike other books in this category that I’ve read so far. This book tells the […]

Tail Recursive nth Fibonacci Number

When a function is called, it gets it’s own stack to store the parameters, and it’s local variables. So, an implementation of recursive function that stores a local variable and waits for the values returned from another recursive call to the function and so on would require stack to store the results. Let’s see an […]

Maximum Subsequence Sum of an Array

First, let’s define what a maximum subsequence sum problem is. Suppose we have an array [5, -3, 4, -7, 8, 7, 4, -1] then we would want to find a contiguous sequence that has the maximum sum. In this case, subsequence [8, 7, 4] has the maximum sum i.e. 19. It’s worth noting that if […]