Question: You are executing Linear ( Sequential ) Search algorithm on an array of size n . Suppose that the key you are searching for is
You are executing Linear Sequential Search algorithm on an array of size n Suppose
that the key you are searching for is included in the array. Also you know that the probability of
finding the key at the last position of the array is and the probability of finding the key at
the second last position is as well. Furthermore, the probability of finding the key at every
other positions are all equal to each other. Answer the following three questions.
a pts What is the probability as a function of n of finding the key at any position between
the first and the third last array positions?
b pts What is the average case complexity function for Linear Search under the
above conditions? Suppose that a comparison as the basic operation.
c pts If your current computer can execute one basic operation in nsec what would be
the expected average running time on an array of size
You are executing Linear Sequential Search algorithm on an array of size Suppose
that the key you are searching for is included in the array. Also you know that the probability of
finding the key at the last position of the array is and the probability of finding the key at
the second last position is as well. Furthermore, the probability of finding the key at every
other positions are all equal to each other. Answer the following three questions.
a pts What is the probability as a function of of finding the key at any position between
the first and the third last array positions?
b pts What is the average case complexity function for Linear Search under the
above conditions? Suppose that a comparison as the basic operation.
c pts If your current computer can execute one basic operation in what would be
the expected average running time on an array of size
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
