import java.util.*; public class TRAII_25_X3_skeleton implements TRAII_25_X3 { // ^^^^^ own id here /** * SELF-EVALUTION HERE: * * */ /** * The speed (time) of the contains() -operation of given Collection. * Result is a typical time of the contains() operation in nanoseconds * for each input size specified in map results. * The times will be stored in map for each input size specified in map results. * * * @param C Collection under test. * @param results map that contains the input sizes to test and is used to store the results. * @param found Do we test case when element is found or not. */ @Override public void containsTimes(Collection C, SortedMap results, boolean found) { // TODO perhaps something here // probably useful to divide to a couple of methods // different element sizes to test for (int collectionSize : results.keySet()) { // TODO // store the result results.replace(collectionSize, -1L /* TODO here the result in nanoseconds */ ); } // TODO possibly something here } // TODO possibly something here Random rnd = new Random(System.currentTimeMillis()); /** * Creates an ArrayList with n random numbers. * Use if you wish. * @param n number of random numbers to create * @return array list with n random numbers */ private ArrayList randomArray(int n) { ArrayList A = new ArrayList<>(n); for (int i = 0; i < n; i++) A.add(rnd.nextDouble()*n); return A; } }