Sorting is fundamental to programming. Often, data is much easier to process if it is arranged into sorted order. Imagine how difficult it would be to use a dictionary if the words were not in order! Sorting is often used to preparing data for further processing.
This chapter explains the concept of sorting and shows one of the common sorting algorithms, insertion sort. The next chapter shows another sorting algorithm.
The first few chapters in this section illustrate sorting algorithms by sorting an array of integers. This shows how the algorithms work using simple data. Often the data to be sorted is more complicated.
Is the following list of integers in sorted order? If not, sort the list into ascending order (smallest element on the left) by clicking and dragging.