Sorting is an important operation of data structure.
Sections 5.1 through 5.6 of this chapter describe the various methods of ordering within, and 5.7 sections describe the methods of sorting out.
In addition, heap ordering is a typical sort of selection, and the algorithm for heap sequencing is described in chapter 8th.
5.1 Basic Concepts
Before discussing the concept of sorting, first introduce the concept of sort code.
A sort code is one or more fields in a node whose values are used as the basis for sorting operations.
The sorting code can be the key code, at this time the sorting is according to the key code to sort the file;
The sort code can also be not a key code, at which point the sorting code for multiple nodes may have the same value, so the sorting result may not be unique.
The data type of the sort code can be either a positive number or a real or a string, or even a complex combination of data types
Basic concepts of sorting