Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What are the selection rules for sorting algorithms?

Shulou Source: shulou.com Published: 2022-06-03 01:22:18 10月27日 Update

What are the selection rules for sorting algorithms? Many novices are not very clear about this. In order to help you solve this problem, the following small series will explain it in detail for everyone. Those who have this need can come to learn. I hope you can gain something.

The general selection rules for various sorting algorithms are as follows:

(1) The number of elements n is large, the sorting code is randomly distributed, and stability is not required---------

(2) The number of elements n is large, memory space is allowed, stability is required-------------

(3) The number of elements n is large, the sorting code may be positive order or reverse order, stability is not required------heap sorting, two-way merging

(4) The number of elements n is small, the sorting code is basically ordered or random, and stability is required-------------

(5) The number of elements n is small, stability is not required-----direct selection sorting

(6) The number of elements n is small, the sorting code is not close to the reverse order---direct insertion sorting

(7) Bubble sorting is rarely used.

Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.

Tags: Sort number element stability selection algorithm rule reverse two-way help order clarity memory content for this article novice more knowledge space Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information MariaDB MySQL Redmi Apple