Saturday, December 27, 2014

Understanding sleep sort: for everyone!

This is an experiment, and I invite everyone to participate, no matter whether you are a programmer or think computers are only useful for reading email. This article is about sorting. In computer science, sorting is not really all that different from every day life. You get some collection of things and you want to put them in order. There must be a way of comparing any two things and understanding what order they belong in. So, if you want to sort grapefruits by size, you can compare any two grapefruits and determine that one is bigger, smaller or the same size as another. Everything else falls out of this, and every time a computer sorts your mail or the messages on Facebook or anything else, it's comparing two items at a time.