2014-11-13 HW

posted Nov 13, 2014, 8:40 AM by Samuel Konstantinovich   [ updated Nov 13, 2014, 8:22 PM ]
//Usted debe llamar su class ArrayListMethods, 
//para que yo verificar que functiona propriamente.

import java.util.*;

public class ArrayListMethods{

    /*Remove any consecutive duplicates in the ArrayList
    *@param L The values which may contain duplicates
    public static void collapseDuplicates( ArrayList<Integer> L ) { }

    /*Change the order of the elements of L into a random permutation
    *@param L The values to be put into random order
*/ public static void randomize( ArrayList<Integer> L) { 
    //How many operations do you perform on a list of size N? (in terms of N)
    //How much extra space did you use in order to complete this problem? (in terms of N)
    //Try to use less space/fewer operations. 
    //->The minimum would be NO extra space, and just k*N operations, for a small integer k.
public static void main(String[]args){ //test your functions here. } }