2.8 How hard can that be?
Once you decide to do something, how long does it take you? How much money or other resources does it involve? How do you compare the worst way of doing it with the best?
All these questions come to bear when you try to accomplish tasks on a computer. The point about money may not be obvious, but when running an application, you need to pay for the processing, storage, and memory you use. This is true whether you paid for a more powerful laptop or have ongoing cloud costs.
To end this chapter, we look at classical complexity. We consider sorting and searching and some algorithms for doing these procedures.
2.8.1 Sorting
Sorting involves taking multiple items and putting them in some kind of order. Consider your book collection. You can rearrange them so that the books are on the shelves in ascending alphabetic order by title. Or you can move them around so they are in descending order by the year of publication...