Compare commits

...

2 Commits

4 changed files with 6 additions and 6 deletions

View File

@ -9,7 +9,7 @@ public class Aufgabe04 {
public static void main(String[] args) { public static void main(String[] args) {
final int laufzeit = 4; final int laufzeit = 4;
final double startwert = 100.0; final double startwert = 100.0;
final double[] zinssaetze = { 2.0, 2.5, 3.0 }; final double[] zinssaetze = new double[] { 2.0, 2.5, 3.0 };
double entwicklung[][] = new double[laufzeit][zinssaetze.length]; double entwicklung[][] = new double[laufzeit][zinssaetze.length];
for (int i = 0; i < laufzeit; i++) { for (int i = 0; i < laufzeit; i++) {

View File

@ -11,7 +11,7 @@ public class Aufgabe05 {
final int DIR_RIGHT = 1; final int DIR_RIGHT = 1;
final int NUM_FROGS = 100; final int NUM_FROGS = 100;
int[] numbersrow = new int[1000]; int[] numbersrow = new int[1000];
int[] bucket = { 0, 0 }; int[] bucket = new int[] { 0, 0 };
int position = 1; int position = 1;
int position_max = position; int position_max = position;

View File

@ -27,7 +27,7 @@ public class Aufgabe01 {
* @return The fibonacci number. * @return The fibonacci number.
*/ */
private static int iterativeFibonacci(int nth) { private static int iterativeFibonacci(int nth) {
int[] fib = { 1, 1 }; int[] fib = new int[] { 1, 1 };
for (int i = 0; i <= nth; i++) { for (int i = 0; i <= nth; i++) {
if (i < fib.length) if (i < fib.length)

View File

@ -12,15 +12,15 @@ import java.util.Random;
public class Aufgabe03 { public class Aufgabe03 {
public static void main(String[] args) { public static void main(String[] args) {
final int MAX_RUNS = 10; final int MAX_RUNS = 10;
int[] sizes = { 10000, 20000, 50000, 100000, 200000, 500000, 1000000, 2000000, 5000000, 10000000, 20000000, int[] sizes = new int[] { 10000, 20000, 50000, 100000, 200000, 500000, 1000000, 2000000, 5000000, 10000000,
50000000 }; 20000000, 50000000 };
for (int size : sizes) { for (int size : sizes) {
long sumArrayList = 0; long sumArrayList = 0;
long sumLinkedList = 0; long sumLinkedList = 0;
ArrayList<String> values = getValues(size);
for (int i = 0; i < MAX_RUNS; i++) { for (int i = 0; i < MAX_RUNS; i++) {
ArrayList<String> values = getValues(size);
sumArrayList += runTestArrayList(values); sumArrayList += runTestArrayList(values);
sumLinkedList += runTestLinkedList(values); sumLinkedList += runTestLinkedList(values);
} }