You are on page 1of 1

nt []burbuja(int[]x){

       for(int i=0; i < x.length; i++){


           for(int j=i+1;j < x.length;j++){
               if(x[i]>x[j]){
                   int rr=x[i];
                   x[i]=x[j];
                   x[j]=rr;
         }
       }
     }
       return x;
   }

.
.
.
.

public static void main(String[] args) {


        Test1 ob=new Test1();
        Scanner l=new Scanner(System.in);
        System.out.println("ingrese la longitud del arreglo:");
        int lng=l.nextInt();
        int [] B = new int[lng];
        ob.lectura(B);
        //ob.Impresion(B);        
        ob.burbuja(B);
        ob.Impresion(B);
  }

You might also like