Question: Sequential Search Algorithm Input: positive integer n array of keys ( integers ) S , indexed from 1 to n a key x Output: the
Sequential Search Algorithm
Input:
positive integer n
array of keys integers S indexed from to n
a key x
Output: the location of x in S if x is not in S
Binary Search Algorithm
Input and Output are the same as above, except the input array S must be sorted.
Note: The symbols represent the floor function.
Task Implement Sequential Search Algorithm, test it on ; and randomly generated numbers, and record the number of keys that were checked until x was found.
Count for :
Count for :
Count for :
Task Implement Binary Search Algorithm, test it on ; and randomly generated sorted numbers, and record the number of keys that were checked until x was found.
Count for :
Count for :
Count for :
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
