关于泡沫分类 [英] about bubble sorting

查看:126
本文介绍了关于泡沫分类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

冒泡排序的代码是什么?

what is the code of bubble sorting?

推荐答案

'冒泡排序'是一种排序数据的算法。您可以在专用维基百科页面 [ ^ ]。

这很容易实现但效率很低。

气泡排序代码是您必须用自己喜欢的编程语言编写的代码,以便在应用程序(或库函数)中转换此类算法。由于链接的维基百科页面提供了伪代码,因此您的任务非常简单。
'Bubble sort' is an algorithm for sorting data. You may find (many) details in the dedicated Wikipedia page[^].
It is easy to implement but very inefficient.
The 'code of bubble sorting' is the code you have to write, in your favourite programming language, in order to transform such an algorithm in an application (or a library function). Since the linked Wikipedia's page provides pseudo-code, your task is really easy.


带有关键字冒泡排序源代码的Google搜索返回指向多个网站的链接显示冒泡排序源代码。以下只是其中的三个。



请注意,冒泡排序的效果不尽如人意。 Shell Sort是一种更好的排序算法。很多年前,我做了一些测试,发现对于超过12个项目,冒泡排序的表现比Shell Sort差。今天可能会有所不同,但冒泡排序不是我选择的排序算法。



用于冒泡排序的C程序 [ ^ ]



Java程序冒泡排序 [ ^ ]



维基百科文章:冒泡排序包括源代码 [ ^ ]
A Google Search with keywords bubble sort source code returns links to several web sites that show the Bubble Sort source code. Below are just three of them.

Note that a Bubble Sort performs less than optimally. A better sort algorithm is Shell Sort. Many years ago, I did some testing and found that for any more than 12 items, bubble sort performed worse than Shell Sort. It may be different today but bubble sort would not be my choice for a sort algorithm.

C program for bubble sort [^]

Java program to bubble sort[^]

Wikipedia article: Bubble Sort including source code[^]


这篇关于关于泡沫分类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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