Question: Consider the code below that removes duplicate integers from a list of integers. Evaluate the number of operations taken by this code under the assumption

Consider the code below that removes duplicate integers from a list of integers. Evaluate the number of operations taken by this code under the assumption that every declaration, assignment, check, negation, subtraction, and LinkedList method takes exactly 1 operation, except contains which we assume uses linear search and thus takes k operations where k is the size of the LinkedList being searched. List removeDuplicates (List dups) { List newList = new Linkedlist (): while (!dups.isEmpty()) if (!newList.contains (dups.get (dups.size() -1)) { newList add (dups.get (dups.size() - 1)): } dups.remove (dups.size()-1): } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
