In last week’s post, I pulled data about local restaurants from Yelp to generate a dataset. I was happy to find that Yelp actually has a very friendly API. This guide will walk you through setting up some boiler plate…
Method Chaining Gone Wrong
Method chaining is the feature available in many programming languages to stack method calls in one line, with each method accessing the object the previous method returned. Compare: The first block’s MyObject class uses traditional setters whereas the second block…
N-Queens Part 3: Success
In the last two posts we explored three different algorithms for solving the n-queens problem. If we wanted to actually implement one of them, we would need to consider which one performs the best. However, performance can be measured in…
N-Queens Part 2: More Algorithms
Last time we were considering the following n-queens board with a current heuristic cost of 5:By making just one move, the best decision would be to move the second queen to the space marked 2. However, to find that move,…
N-Queens Part 1: Steepest Hill Climbing
The n-queens problem was first invented in the mid 1800s as a puzzle for people to solve in their spare time, but now serves as a good tool for discussing computer search algorithms. In chess, a queen is the only…