public class BubbleSort : SortBase { public BubbleSort(int num, int[] arr): base(num,arr) { } public overri...
分类:
其他好文 时间:
2014-07-09 19:26:54
阅读次数:
159
一、BubbleSort and XListview1、BubbleSort(1)analysistraverse、compare、exchange、cycle、optimizestrategyloop outside times n-1loop inside times n-i-1 it redu...
分类:
其他好文 时间:
2014-07-09 15:28:14
阅读次数:
185
#include#includevoid bubbleSort(int arr[],int n){ int i,j; for(i=n-1;i>0;i--) for(j=n-2;j>=n-i-1;j--) { if(arr[j+1]>arr...
分类:
其他好文 时间:
2014-06-18 18:07:15
阅读次数:
154
package foo;public class Main { public static void bubbleSort(int[] a, int len) { int in, out; for (out = len - 1; out > 0; --out) { ...
分类:
其他好文 时间:
2014-06-18 14:18:37
阅读次数:
158
1、冒泡排序
1)原理说明:重复遍历要排序的数列,一次比较两个元素,如果他们的顺序错误就把他们交换过来。走访数列的工作是重复地进行直到没有再需要交换,也就是说该数列已经排序完成。
2)代码实现:
package com.test.sort;
public class BubbleSort
{
public static void sort(int[] data)
{
...
分类:
编程语言 时间:
2014-06-16 20:00:39
阅读次数:
253
冒泡排序法是一种经典的、入门级的排序算法。它重复地遍历整个数组,对数组的元素进行两两比较,如果两数的顺序有误,则将两数字交换。
由于在比较的过程中,最小的数先变换到数列的顶端,其次是第二小的数……直至所有数字完成排序,因而得名冒泡排序。...
分类:
其他好文 时间:
2014-06-05 11:39:09
阅读次数:
194
public class BubbleSort{ public static void
main(String[] args){ int score[] = {67, 69, 75, 87, 89, 90, 99, 100}; for (int i
= 0; ...
分类:
其他好文 时间:
2014-05-27 17:09:26
阅读次数:
326
算法源码://BubbleSort.cpp#include using namespace
std;void BubbleSort(int a[], int n){ for(int i=n-1;i>0;i--) { for(int
j=0;ja[j+1]) { int tmp = a[j...
分类:
其他好文 时间:
2014-05-27 02:07:07
阅读次数:
223
void BubbleSort(int a[], int n){ int i = 0; int j =
0; int tmp = 0; for (i = 0; i a[j]) { tmp = a[i]; ...
分类:
其他好文 时间:
2014-05-20 01:11:07
阅读次数:
215
1、算法思想描述: 1)将相邻的两个数进行比较,如果前面的一个大于后面的一个,则将他们交换。每次循环能使一个数达到有序状态。2、时间复杂度: 平均O(n^2)3、实现及优化。以下给出三种实现方式/*
* bubblesort.cpp
*
* Created on: 2014年5月17日
* Author: pc
*/
#include
#include
#inc...
分类:
其他好文 时间:
2014-05-18 15:34:55
阅读次数:
198