Preface
Algorithm is a kind of calculation rule. How to find a certain value, categorize certain values, sort certain values, match certain values, etc. through a calculation rule. Today I will show you the sorting algorithm. I think you will often use Order By. Strategies to complete the sorting of data. Let’s show you the behavioral effects of data sorting and deepen your understanding of the algorithm.
Original link: https://juejin.cn/post/6896792265172189192 Source: Nuggets
Sorting algorithm summary
time complexity
-
O(n2)[square order] sort
- Direct insertion, direct selection, bubble sort
-
O(nlog2n)【Linear logarithmic order】 Sort
- Quick sort, heap sort, merge sort
-
O(n1+§)) sorting, § is a constant between 0 and 1
- Hill sort
-
O(n)【Linear order】Sort
- Cardinal sorting, bucket sorting, bin sorting
Bubble Sort
Select sort
Insertion sort
Merge sort
Quick sort
Heap sort
Count sort
Base sort
Thank you for seeing here!
I have also compiled some learning materials on data structures and algorithms and some of the latest interview questions.
Friends in need can click here to get it for free, the code: CSDN .
Pay attention, don't get lost! If this article is helpful to you, don't forget to like and support! thank you!