Question: a.public static void myPopulateRandomly(List inList, int howMany) This method populates inList with howMany randomly-generated ints. Note that inList is either an ArrayList or a LinkedList.

a.public static void myPopulateRandomly(List inList, int howMany)

This method populates inList with howMany randomly-generated ints. Note that inList is either an ArrayList or a LinkedList. Regardless, your implementation must run as efficiently as possible.

b.public static void myRemoveAll(List inList)

This method removes all the elements from inList.

Note that inList is either an ArrayList or a LinkedList. Regardless, your implementation must run as efficiently as possible.

c.public static int myHowManyGreaterThan(List inList, int target) .

This method returns the number of elements in inList that are strictly greater than target.

Note that inList is either an ArrayList or a LinkedList. Regardless, your implementation must run as efficiently as possible.

This is what I think

code:

public static void myPopulateRandomly(ArrayList inList,int howMany){ Random a = new Random(); for (int i = 0; i < howMany; i++){ int r = a.nextInt(); inList.add(r); } } public static void myRemoveAll(LinkedList inList){ for (int i=0; i < inList.size(); i++){ inList.remove(i); } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!