Sort - Basic Concepts

What is a sort?

A set of data disorganized sequential arrangement according to certain rules together. Sort purpose is easy to find.


How to measure the quality of sorting algorithms?

Time efficiency: Sorting speed (ie, the number of comparisons to sort all it takes)

Space efficiency: accounting for the size of the memory space of the auxiliary

Stability: If A and B are two recording key values are equal, but the sort A, B priorities remain unchanged, this sorting algorithm is called stable.


Internal and external sorting sorting

Internal sequencing: If the records are to be sorted in memory, called the internal order.

There are two basic operations internal sort:

  • Compare the size of two keywords; (essential for operation)
  • Mobile storage location.

External sorting: if part of the record to be sorted in the memory part in the external memory, is called external sorting.


How to be sorted records storage and processing in memory?

Sort Order - logical sequential relationship among data embodied adjacent its physical storage location, moving records directly sorting, less data where appropriate.

List sort - logical sequential relationship among data in a node pointer reflects only modified when sorting pointer does not move the data, the data for more cases.

Address sort - for a continuous data stored in the address space, a secondary table configured to store addresses of data held (pointer), to modify the address of the secondary sorting table, and finally moving recorded data more suitable for the situation.


Common sorting algorithm

Here Insert Picture Description

Guess you like

Origin blog.csdn.net/starter_____/article/details/93742871