【Data Structure Learning Record 30】——Comparison of various internal sorts

1. Performance analysis

Insert picture description here

2. Application

Application considerations:
number of elements, element size, keyword structure and distribution, stability, storage structure, auxiliary space, etc.

  1. If n is small (n≤50), direct insertion sort or simple selection sort can be used.
    When n is large, fast sort, heap sort or merge sort can be used
  2. If n is large, the record key has fewer digits and can be decomposed, and the radix sort is used
  3. When the n keywords of the file are randomly distributed, any sorting by means of "comparison" requires at least O(nlogzn) time
  4. If the initial order is basically in order, use direct insertion or bubble sort
  5. When the record element is relatively large, a large number of moving sorting algorithms should be avoided, and chain storage should be used as much as possible

3. Conclusion

Now the data structure of the postgraduate entrance examination is probably completed, and I have gone through the tutorial myself. There are still some interesting content, such as dynamic memory management and other unlearned parts, which will be learned by myself and added here.
Now, it’s over ✿✿ヽ(°▽°)ノ✿
Insert picture description here

Guess you like

Origin blog.csdn.net/u011017694/article/details/111565419