Auf Thema antworten

[code=Java]

    public int[] bubbleSort(){

        final int anz = 21;

        int [ ] zahl = new int [anz];

        for(int i=anz-2; i>=0 ;i--){

            for(int j=0; j<=i; j++){

                if(zahl[j]<zahl[j+1]){

                    int temp=zahl[j];

                    zahl[j]=zahl[j+1];

                    zahl[j+1]= temp;

                }

            }

        }

        return zahl;

    }

[/code]


da kannst ja mal reinschauen, was so genau in "zahl" drinsteckt ...



Oben