Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5) Use the following array to trace the first two iterations of the binary search algorithm for the specified target value. For each iteration, indicate

5) Use the following array to trace the first two iterations of the binary search algorithm for the specified target value. For each iteration, indicate the midpoint index, and the index range [first, last] for the sublist in the next iteration. Hint: the index starts from zero and the midpoint index is equal to [(first+last)/2]
Array with 9 elements: 2, 10, 19, 23, 28, 35, 45, 51, 55
Target 51
Iteration 1: Midpoint index: _________________________
Index range for the next sublist: [ _________________, _______________ ]
Iteration 2: Midpoint index: _________________________
Index range for the next sublist: [ _________________, _______________ ]

5; [6,9]; 7; [8,9]

28; [35,55]; 45; [51,55]

4; [5,8]; 6; [7,8]

6)

Which of the following algorithms are not based on swapping elements?

Bubble sort

Merge sort

Insertion sort

Selection sort

7)

Which of the following algorithms performance is not affected by the state of the input array to be sorted?

Insertion sort

Bubble sort

Selection sort

Merge sort

8) Binary searches worst case Big O time complexity is the same as its average case Big O time complexity

True

False

9) Assume you have a set of arrays sorted in reverse order of increasing size. Which of the following sorting algorithms would you expect to display the best Big O time complexity?

Optimized Bubble sort

Merge sort

Selection sort

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_2

Step: 3

blur-text-image_3

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

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions

Question

2. What reagent would you use for the following transformation? ?

Answered: 1 week ago

Question

Compare the different types of employee separation actions.

Answered: 1 week ago

Question

Assess alternative dispute resolution methods.

Answered: 1 week ago

Question

Distinguish between intrinsic and extrinsic rewards.

Answered: 1 week ago