Question: id: 4103409 Question 1 [2 marks]: Linear search vs Binary search Take your 7-digit Taibah University ID. Example: 4103409 Write it in sorted order in

 id: 4103409 Question 1 [2 marks]: Linear search vs Binary search

Take your 7-digit Taibah University ID. Example: 4103409 Write it in sorted

id: 4103409

Question 1 [2 marks]: Linear search vs Binary search Take your 7-digit Taibah University ID. Example: 4103409 Write it in sorted order in an array. Example: 0013 4 4 9 Take item = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, one by one Search in the sorted order by two search techniques that we have seen in Lecture 2 (linear search in Slide 6, and binary search in Slide 8) Write the number of steps that you need before you stop (stop can be two types: found and stop, or not available and stop) and write "found" or "not found" for each item from 0 to 9 Fill out the following table with your steps Example for 0 0 1 3 4 4 9: 1 3 4 5 6 7 8 9 Item 0 Linear 1 search (found) 2 4 (not found) 1+1+1+1 (not found) Binary 1+1 search (found) Fill out this table for your ID digits in sorted order. 0 1 2 3 4 5 6 7 8 9 Item Linear search Binary search Question 1 [2 marks]: Linear search vs Binary search Take your 7-digit Taibah University ID. Example: 4103409 Write it in sorted order in an array. Example: 0013449 Take item = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, one by one Search in the sorted order by two search techniques that we have seen in Lecture 2 (linear search in Slide 6, and binary search in Slide 8) Write the number of steps that you need before you stop (stop can be two types: found and stop, or not available and stop) and write "found or not found for each item from 0 to 9 Fill out the following table with your steps Example for 0 0 1 344 9: 1 3 4 5 5 6 7 8 00 9 Item 0 Linear 1 search (found) 2 4 (not found) 1+1+1+1 (not found) Binary 1+1 search (found) Fill out this table for your ID digits in sorted order. 0 1 2 3 4 5 6 7 8 9 9 Item Linear search Binary search

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!