网站首页  英汉词典

请输入您要查询的英文单词:

 

单词 Selection sort
释义

Selection sort

中文百科

选择排序

选择排序的示例动画。红色表示当前最小值,黄色表示已排序串行,蓝色表示当前位置。

选择排序(Selection sort)是一种简单直观的排序算法。它的工作原理如下。首先在未排序串行中找到最小(大)元素,存放到排序串行的起始位置,然后,再从剩余未排序元素中继续寻找最小(大)元素,然后放到已排序串行的末尾。以此类推,直到所有元素均排序完毕。

选择排序的主要优点与数据移动有关。如果某个元素位于正确的最终位置上,则它不会被移动。选择排序每次交换一对元素,它们当中至少有一个将被移到其最终位置上,因此对n个元素的表进行排序总共进行至多n-1次交换。在所有的完全依靠交换去移动元素的排序方法中,选择排序属于非常好的一种。

英语百科

Selection sort 选择排序

Selection sort animation. Red is current min. Yellow is sorted list. Blue is current item.

In computer science, selection sort is a sorting algorithm, specifically an in-place comparison sort. It has O(n) time complexity, making it inefficient on large lists, and generally performs worse than the similar insertion sort. Selection sort is noted for its simplicity, and it has performance advantages over more complicated algorithms in certain situations, particularly where auxiliary memory is limited.

随便看

 

英汉网英语在线翻译词典收录了3779314条英语词汇在线翻译词条,基本涵盖了全部常用英语词汇的中英文双语翻译及用法,是英语学习的有利工具。

 

Copyright © 2004-2024 encnc.com All Rights Reserved
更新时间:2025/6/17 20:44:27