Do not lie to you! 9 pictures show you how to understand the algorithm

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

Insert picture description here

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

Insert picture description here

Select sort

Insert picture description here

Insertion sort

Insert picture description here

Merge sort

Insert picture description here

Quick sort

Insert picture description here

Heap sort

Insert picture description here

Count sort

Insert picture description here

Base sort

Insert picture description here

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 .

Insert picture description here

Insert picture description here

Pay attention, don't get lost! If this article is helpful to you, don't forget to like and support! thank you!

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41770757/article/details/109963508