Java Bubble Sort bubbleSortArray(String[] str)

Here you can find the source of bubbleSortArray(String[] str)

Description

bubble Sort Array

License

Open Source License

Declaration

public static String[] bubbleSortArray(String[] str) 

Method Source Code

//package com.java2s;

public class Main {

    public static String[] bubbleSortArray(String[] str) {

        String temp = null;/*from  w  ww  . j a v a2  s.  c om*/
        for (int i = str.length - 1; i > 0; --i) {
            for (int j = 0; j < i; ++j) {
                if (str[j + 1].length() < str[j].length()) {
                    temp = str[j];
                    str[j] = str[j + 1];
                    str[j + 1] = temp;
                }
            }
        }
        return str;
    }
}

Related

  1. bubbleSort(int[] a)
  2. bubbleSort(int[] array)
  3. BubbleSort(int[] data)
  4. bubbleSort(int[] source)
  5. bubbleSort(String[] p_array)
  6. bubbleSorting(double array[], double[] diagramsUsed)
  7. bubblesortList(String[][] SortList)