Question: Question 1 [15 marks] Answer the following questions based on the sorted array named Temp shown in Figure Bl.1. The array contains temperature values in

 Question 1 [15 marks] Answer the following questions based on thesorted array named Temp shown in Figure Bl.1. The array contains temperature

Question 1 [15 marks] Answer the following questions based on the sorted array named Temp shown in Figure Bl.1. The array contains temperature values in degree Celsius for one week [O] [2] [3] [4] [5] [6] Temp 26 29 32 35 39 40 44 Figure B1.1: Temp array (a) Perform improved linear search using SortedSeqSearch() function for searching temperature value = 35. Show tracing of your search using variables index, p. search_key, array[p], and found as shown in the table format below: [4 marks] index search_key Temp [p] Found (6) Perform binary search for searching temperature value = 49. Show tracing of your search using variables index, LEFT, RIGHT, MIDDLE, search_key, Temp [MIDDLE], and found as shown in the table format below: [4 marks] Index LEFT RIGHT MIDDLE array[MIDDLE) search_key found (C) Fill in the following table with the number of steps and the complexity time for searching key = 29.35 and 49. Based on the results, compare and discuss the efficiency of binary search and linear search on sorted data) algorithms in the three searching case. [7 marks] Search Searching Comparisons Linear Search Binary Search Number of Steps Complexity Nunber of Steps Complexity Discussion

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!