Suppose you are a real estate developer. These days, the market is getting tight so you have decided to turn to algorithms to give you an edge over the competition. You have purchased an irregularly shaped plot of land which you have divided into a square grid. For each square, you have […]
A question often asked in interviews is: what’s the best way to store a set? There are many different ways to store well-ordered data so that it can be queried quickly. Many people find that a hash table gives them the best performance characteristics, so much so that if you are in an […]
I’ve made a few tweaks to the blog. There are a few minor cosmetic changes. Also, comments are now protected using WP HashCash. Contact me via email if you have trouble.
I’m preparing a new algorithm post which should be ready within 12 hours. Stay tuned!
So, I’ve totally been writing this blog for almost a week, but so far I haven’t talked about how an actual algorithm works. Here’s a classic algorithm.
Let’s say you have an array of n elements a[0] through a[n-1]. You would like to generate a random permutation of this array. This means that […]