请输入您要查询的字词:

 

单词 bubble sort
释义
bubble sort

Statistics
  • A simple but not very efficient algorithm for arranging a set of n numbers in order of increasing magnitude. The method starts with the right-hand pair of numbers, swapping if necessary so that the smaller number is on the left of the pair, and proceeds towards the left, making a total of (n−1) comparisons. At the end of this pass the smallest number is at the left end of the line. The algorithm recommences with the right-hand pair of numbers and again proceeds towards the left. This time (n−2) comparisons are made and the pass ends with the second-smallest number in second position. The procedure is repeated until the complete ordering is achieved: this requires a total of n(n−1) comparisons.

    16

    8

    13

    4

    ×

    16

    8

    4

    13

    ×

    16

    4

    8

    13

    ×

    4

    16

    8

    13

    4

    16

    8

    13

    ×

    4

    8

    16

    13

    ×

    4

    8

    13

    16

    Bubble sort. Illustration of the simple neighbour-swapping algorithm. In the example × indicates a swap and ○ that no swap is required.


Computer
  • A form of sorting by exchanging that simply interchanges pairs of elements that are out of order in a sequence of passes through the file, until no such pairs exist. The method is not competitive with straight insertion.


随便看

 

科学参考收录了60776条科技类词条,基本涵盖了常见科技类参考文献及英语词汇的翻译,是科学学习和研究的有利工具。

 

Copyright © 2000-2023 Sciref.net All Rights Reserved
京ICP备2021023879号 更新时间:2025/2/6 2:00:32