added all past projects

This commit is contained in:
Hannes
2017-11-10 00:13:57 +01:00
parent 5f63f0c599
commit 8c94608805
1391 changed files with 109456 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
package bubblesort;
public class Bubblesort {
static double[] arr = new double[400000];
static int start = 0, ende = arr.length - 1;
public static void main(String[] args) {
// TODO code application logic here
fillArray();
while(start != ende)
{
int aktuelles = start;
int bestes = start;
do {
aktuelles++;
if(bestes < aktuelles)
{
bestes = aktuelles;
}
} while (aktuelles != ende);
tausche(bestes, start);
}
//ausgabe();
}
public static void ausgabe()
{
for (int i = 0; i < arr.length; i++) {
System.out.println(arr[i]);
}
}
public static void tausche(int zeiger1, int zeiger2)
{
double tmp = arr[zeiger1];
arr[zeiger1] = arr[zeiger2];
arr[zeiger2] = tmp;
start++;
}
public static void fillArray()
{
for (int i = 0; i < arr.length; i++) {
arr[i] = Math.random();
}
}
}