Question: Exercise 2 Assume the class SortedList is an array implementation of the Sorted List ADT, as given in lectures. Write a method index(self, item) for

Exercise 2 Assume the class SortedList is an array implementation of the Sorted List ADT, as given in lectures. Write a method index(self, item) for SortedList which has a worst time complexity of Olog(N)), where N is the length of the list. The method inder finds the first index of item in the list, and raises a valueError if the item is not in the list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
