Question: Consider the following method, remDups, which is intended to remove duplicate consecutive elements from nums, an ArrayList of integers. For example, if nums contains {
Consider the following method, remDups, which is intended to remove duplicate consecutive elements from nums, an ArrayList of integers. For example, if nums contains then after executing remDupsnums nums should contain
public static void remDupsArrayList nums
for int j ; j nums.size; j
if numsgetjequalsnumsgetj
nums.removej;
j;
The code does not always work as intended. Which of the following lists can be passed to remDups to show that the method does NOT work as intended?
A
B
C
D
E
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
