X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=exo2%2FMain.java;h=75c828bb2d17edca3f2627bcffaf59226967b55c;hb=e1499f74d5264f2205c54bf9b1a4c66fd447a844;hp=2df8729213d967716022dd7cc45a31b9727272f9;hpb=01bad5b37bf95f027f583e1b1da607e074050651;p=Project_POO.git diff --git a/exo2/Main.java b/exo2/Main.java index 2df8729..75c828b 100644 --- a/exo2/Main.java +++ b/exo2/Main.java @@ -18,20 +18,20 @@ class Main { } long startTime = System.nanoTime(); - //for (int i = 0; i < 100000; i++) { - // array.addMiddleIter(i); - //} - array.addNEMiddle(100000); + // for (int i = 0; i < 100000; i++) { + // array.add(array.size() / 2, i); + // } + array.addNelements(array.size() / 2, 100000); long stopTime = System.nanoTime(); long execTimeArray = stopTime - startTime; //System.out.println("Insert time in the middle of the ArrayList: " + TimeUnit.NANOSECONDS.toSeconds(execTime) + " s"); System.out.println("Insert time in the middle of the ArrayList: " + execTimeArray + " ns"); startTime = System.nanoTime(); - //for (int i = 0; i < 100000; i++) { - // list.addMiddleIter(i); - //} - list.addNEMiddle(100000); + // for (int i = 0; i < 100000; i++) { + // list.add(list.size() / 2, i); + // } + list.addNelements(list.size() / 2, 100000); stopTime = System.nanoTime(); long execTimeLinked = stopTime - startTime; //System.out.println("Insert time in the middle of the LinkedList: " + TimeUnit.NANOSECONDS.toSeconds(execTime) + " s");