Kadane’s Algorithm: The Key to Optimal Subarray Sum

The maximum subarray problem is all about finding a contiguous subarray with the largest sum. Basically, you need to look at an array of numbers and find the chunk that adds up to the biggest total. For example, if you have the array [-2, 1, -3, 4, -1, 2, 1, -5, 4], the contiguous subarray […]

A Guide to Understanding Order of Growth

Psst, hey you. Yeah, you. Have you seen this chart? Every software engineer worth their salt should remember this bad boy. It’s all about Big O concepts, which are super important, especially when designing APIs. That’s it. That’s the tweet. But seriously, Big O notation is key for understanding how algorithms scale and how much […]

Optimizing Your Search Algorithms: Notes on Quiescent Search and Branching Factor

Branching Factor The branching factor is the number of children at each node. The effective branching factor is the number of children generated by a "typical" node for a given search problem. Quiescent Search A full-width search sees everything up to its horizon, and nothing beyond. This is called the horizon effect. It’s like not […]

Mastering Search Optimization: An Introduction to Iterative Deepening

Depth-First Search (DFS) In DFS, we start from a node and go down a path until we reach a node that has no children. Whenever we run out of moves, we backtrack and explore the sibling of the node. And if there are no siblings, we go for the sibling of the grandparent and so […]