Question: Jump search is a searching algorithm that skips some items of a sorted array in place of searching all the items. Let n be the

Jump search is a searching algorithm that skips some items of a sorted array in
place of searching all the items. Let n be the number of items in a given array; the
optimal size k of jump is given by n2.
For instance, consider the array 0,2,5,6,8,9,12,15,16; in this case, n=9 and
k=3. When we search 15 in the given array using jump search algorithm, we jump
3 times (5916), and do linear search for 2 items (1215); thus, the total
number of comparisons is 3+2=5. Similarly, when we search 10, we jump 3 times
(5916), and do linear search for 1 item (12); thus, the total number of
comparisons is 3+1=4. Now, answer the following questions.
What is the average number of comparisons when you use jump search
algorithm for the given array? Assume that you search a random integer between
1 and 9.[10 points]
1,2,3,4,5,6,7,8,9
What is the average number of comparisons when you use jump search
algorithm for the given array? Assume that you search a random integer between
1 and 17.[10 points]
1,3,5,7,9,11,13,15,17
There is a solution i chegg. But I don't think it's right. Clarify the num for comparisons of each number. Is num of comparison at (1) for 1 is 1 or 2?
 Jump search is a searching algorithm that skips some items of

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!