Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Database Programming With Visual C# .NET

Authors: Ying Bai

1st Edition

0470467274, 978-0470467275

More Books

Students also viewed these Databases questions