You are on page 1of 1

/* * To change this template, choose Tools | Templates * and open the template in the editor.

*/ /** * */ public class OREN_BURBUJA { private static int o; private static int i; public static void main(String[] args) { int []num=new int[20] ; int hold,j,pass; boolean cambio=true; for(pass=o;(pass<num.length-1)&&(cambio==true);pass++){ cambio=false; for(j=0;j<num.length-1;j++) if(num[j]>num[j+i]){ cambio=true; hold=num[j]; num[j]=num[j+1]; num[j+1]=hold; } } } }

You might also like