Imagine you want to sort a stack of pancakes by size with the largest pancake at the bottom of the stack, the next one on top and so on with the smallest pancake ending up on top of the stack. It may seem silly to you but this is a problem being studied by mathematicians. One way to sort the stack is to look for the largest pancake, pick up this pancake + all the ones above and turn them over so that the largest pancake is now at the top. Then turn the whole stack over. The largest pancake is now at the bottom of the stack. This process can be repeated until the whole stack is sorted. This procedure requires 2 flips per pancake and mathematicians have been looking for faster solutions. In the 70s Bill Gates invented an algorithm while still at Harvard that does this faster and he published his only scientific paper on this. You can go and get it from Elseviers or just download it from this blog.
Leave a comment