Breadth-first search using Go standard library

Just like many Go developers out there, I’m a big fan of Go standard library. Over the past few years I’ve been hacking on Go, I’ve discovered some real gems that not only made my life as a developer easier (no need to maintain unnecessary code), but they also made my code considerably more readable for others to follow. The last time I blogged I talked about how you can leverage Go standard library to generate weighted random draws. [Read More]

Weighted Random Draws in Go

When working on my last project I needed to find a way to draw a random number from a list based on some weight assigned to it i.e. given a list of numbers each of which has a weight assigned to it, I had to find a way to draw a number from the list based on the weight. The numbers which have higher weight assigned to them should be more likely to be drawn than the numbers with lower weights. [Read More]