Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.ArrayList;
- public class Burbuja {
- public void Ordenar( ArrayList<Integer> arreglo, int tam){
- int x, y, aux;
- for(x=0;x<tam-1; x++){
- for(y=x+1;y<tam;y++){
- if(arreglo.get(x)>arreglo.get(y)){
- aux=arreglo.get(x);
- arreglo.set(x, arreglo.get(y));
- arreglo.set(y, aux);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement