Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve the following questions: Please show your work in solving it and in clear writing. Thank You. Multiple Choice For each question, select the

Please solve the following questions:

image text in transcribed

Please show your work in solving it and in clear writing. Thank You.

Multiple Choice For each question, select the best answers that apply. More than one answer can be identified and D is always going to be "None of the above". This means no question will have multiple answers with D selected (such as A and D). The minimum to circle is at least one answer and the most would be A, B and C. Each question is worth 3 points. 1) Which of the following is true about the binary search algorithm? a. If you use it on a sorted array, the performance in the worst case scenario is O(log n) b. If you use it on an unsorted array, the performance in the worst case scenario is 0(1) c. Binary search performance in the worst case scenario degrades to O(n) if the size of the array gets too large d. None of the above 2) Which of the following is true about inserting elements using binary search into a sorted array? a. The performance in the worst case scenario is O(n) because of the shifting of elements b. The performance in the worst case scenario is O(log n) because of the use of binary search to find the index to insert the new element C. Even though insert using linear search and insert using binary search are both O(n), in the worst case insert with linear search is a guaranteed O(n) while insert with binary search is O(log n) + O(n) d. None of the above 3) Which of the following is true about the deleting elements in sorted array? Worst case scenario for delete is O(log n) b. If you used binary search to find the element to delete and found it at the end of the array, the performance is O(n) because you have to shift all elements c. If you delete using linear search to find the element, the performance in the worst case is O(na) d. None of the above a

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

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

Discuss the states of accounting

Answered: 1 week ago

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago