Chapter 2: Sorting

If I give you randomized stack of 5 papers with numbers on them ask you to put them in order, how would you do it? Does your answer change if the stack has 10 papers? 100 papers? 1,000,000 papers?

The approach you take to organize sortable information unsurprisingly impacts how quickly you can do it. In this chapter, we will explore different already-established algorithms for sorting a list of items. Each method has benefits and drawbacks, which we will explicitly state at the end of the chapter.

Each of the first sections describes a different sorting algorithm. Your task is to determine how to code each one. There are tons of resources available online (I like Wikipedia for good information) including sample code pieces that tell you exactly how to do it. Generally I thoroughly encourage using resources that already exist, however try not to look up sample code because that defeats the purpose of challenging yourself to write the algorithms in this case.

← Previous PageNext Page →