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

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

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!