选择或插入排序在学术环境之外有用吗? [英] Are Selection or Insertion sort useful outside of academic environments?

查看:118
本文介绍了选择或插入排序在学术环境之外有用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些排序算法在实际应用中是否有用?

Do these sorting algorithms have any use in real world application?

还是仅仅是n ^ 2复杂度的排序算法的基本示例?

Or is it just a basic example of sorting algorithm with n^2 complexity?

有人可以给一些吗?用法示例?

Can anyone give some example of its usage?

推荐答案

插入排序是用于对非常小的数组进行排序的最快排序算法之一。

Insertion sort is one of the fastest sorting algorithm for sorting very small arrays.

实际上,当要排序的子数组低于特定阈值时,许多quicksort / mergesort实现会停止,然后将插入排序用于这些小数组。

In practice, many quicksort / mergesort implementations stop when the subarrays to sort is below certain threshold, and insertion sort is then used for these small arrays.

选择排序在实践中很少使用。

Selection sort is rarely used in practice.

这篇关于选择或插入排序在学术环境之外有用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆