Dynamic graph demonstration of top 10 classic sorting algorithms. It’s enough to read this article! (with corresponding code)

Sorting algorithm is one of the most basic algorithms in data structure and algorithm.

Sorting algorithms can be divided into internal sorting and external sorting.

Internal sorting is the sorting of data records in memory.

External sorting is due to the large sorting data, which can not accommodate all sorting records at one time. External memory needs to be accessed in the sorting process.

Common internal sorting algorithms include: insert sort, Hill sort, select sort, bubble sort, merge sort, quick sort, heap sort, cardinal sort, etc.

Summarize with a picture:

About time complexity:

About stability:

1. Bubble sorting

1.1 algorithm steps

1.2 animation demonstration

1.3 reference code

2. Select Sorting

2.1 algorithm steps

2.2 animation demonstration

2.3 reference code

3. Insert sort

3.1 algorithm steps

3.2 animation demonstration

3.3 reference code

4. Hill sort

4.1 algorithm steps

4.2 animation demonstration

4.3 reference code

5. Merge and sort

5.1 algorithm steps

5.2 animation demonstration

5.3 reference code

6. Quick sort

6.1 algorithm steps

6.2 animation demonstration

6.3 reference code

7. Heap sorting

7.1 algorithm steps

7.2 animation demonstration

7.3 reference code

8. Count sorting

8.1 algorithm steps

8.2 animation demonstration

8.3 reference code

9. Bucket sorting

9.1 algorithm steps

9.2 animation demonstration

9.3 reference code

10. Cardinality sorting

10.1 algorithm steps

10.2 animation demonstration

10.3 reference code

The idea of this paper comes from: https://github.com/hustcc/JS-Sorting-Algorithm

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>