Exercise 2.2-3 Consider linear search again (see Exercise 2.1-3). How many elements of the input sequence need to be checked on the average, assuming that the element being searched for is equally likely to be any element in the array? How about in the worst case? What are the average-case and worst-case running times of linear search in -notation? Justify your answers.
- Posts: 47
- Joined: Sat May 10, 2008 2:56 am
Return to Chapter 2
Who is online
Users browsing this forum: No registered users and 1 guest