miércoles, 16 de marzo de 2016

cubesort: cubesort

cubesort: cubesort:  Cubesort   Greetings , I am jenny engineering, today I will talk about the cubesort method used mainly in data structure. This s...

cubesort

 Cubesort
 
Greetings, I am jenny engineering, today I will talk about the cubesort method used mainly in data structure.
This sorting method is quite stable, can compare almost any type of data, its speed is quite fast, the bucket keeps stored, orders quickly almost any type of data, as was mentioned, when random data concerned the aproximadamene memory elements exhausts 100k.
Advantages:
-Speed fast.
-over The tree sorting methods.
 
 

then I share code in java:
 
 
 
  1. public class Cube {
  2.     public static int movement1, movement2, cube; 
  3.     public static void main(String[] args) {
  4.         int arreglo[] = {33, 65, 14, 8, 22}; 
  5.  
  6.        
  7.         System.out.println("No esta ordenado"); 
  8.        
  9.         for (int i = 0; i < arreglo.length; i++) { 
  10.            
  11.             System.out.println(arreglo[i] + " ");
  12.            
  13.         }
  14.        
  15.         System.out.println(" ");
  16.        
  17.         movement1 = 1;
  18.        
  19.         movement2 = arreglo.length;
  20.        
  21.         cube = arreglo.length - 1;
  22.        
  23.         do {
  24.            
  25.             for (int i = arreglo.length - 1; i > 0; i--) {
  26.                
  27.                 if (arreglo[i - 1] > arreglo[i]) {
  28.                    
  29.                     int aux = arreglo[i];
  30.                    
  31.                     arreglo[i] = arreglo[i - 1];
  32.                    
  33.                     arreglo[i - 1] = aux;
  34.                    
  35.                     cube = i;
  36.                    
  37.                 }
  38.                
  39.             }
  40.            
  41.             movement1 = cube + 1;
  42.            
  43.             for (int j = 1; j < arreglo.length; j++) {
  44.                
  45.                 if (arreglo[j - 1] > arreglo[j]) {
  46.                    
  47.                     int aux = arreglo[j];
  48.                    
  49.                     arreglo[j] = arreglo[j - 1];
  50.                    
  51.                     arreglo[j - 1] = aux;
  52.                    
  53.                     cube = j;
  54.                    
  55.                 }
  56.                
  57.             }
  58.            
  59.             movement2 = cube - 1;
  60.         } while (movement2 >= movement1);
  61.        
  62.         System.out.println("Ordenada");
  63.        
  64.         for (int i = 0; i < arreglo.length; i++) {
  65.            
  66.             System.out.println(arreglo[i] + " ");
  67.            
  68.         }
  69.        
  70.     }
  71. }
 
 
I hope I helped, in this method cubesort ordination, there is additional information at the top, see you later.
 
-Jenny engineer