Question: 2. When doing a binary search on this sorted data set: ABCDEFGHIJKLMNO A. Which letters will be tested when searching for A? B. Which letters

 2. When doing a binary search on this sorted data set:

2. When doing a binary search on this sorted data set: ABCDEFGHIJKLMNO A. Which letters will be tested when searching for A? B. Which letters will be tested when searching for J? C. Which letters will be tested when searching for E? D. Which letters will be tested when searching for Z? 3. Fill in the following table with the average case and worst case for the number of comparisons likely to be needed to find an element in a list of the given size using a sequential search and using a binary search. It's OK to give a close estimate of the average case, but provide your reasoning, formula, or an Internet source for why that is a good estimate. Size of List Average Case Average Case Worst Case Worst Case Sequential Search Binary Search Sequential Search Binary Search 100 1,000 10,000 1,000,000 1,000,000,000 4. Suppose you have a series of 10 storage locations named S[1], S[2), etc. thru S[10]. Using a while loop, an index variable K, and 1 temporary storage location named T, write an algorithm that will reverse the order of values in the storage locations so that S[1] holds the value formerly in S[10], S[2] holds the value formerly in S[9], etc., and S[10] holds the value formerly in S[1]. Use the index variable or an expression inside the square brackets of SI] to indicate which storage location is being accessed. 5. Rewrite the algorithm for the previous question (the reverse-the-storage-locations problem) so that it will work properly with N storage locations, where N is any positive integer

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!