Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Data Structures Questions Chapter 12 Searching I need answers and explanations..

ID: 3659771 • Letter: D

Question

Data Structures Questions Chapter 12 Searching I need answers and explanations.. Short Answers #1. Here is an array with exactly 15 elements: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Suppose that we are doing a serial search for an element. Circle any elements that will be found by examining two or fewer numbers from the array. #2. Here is an array with exactly 15 elements: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Suppose that we are doing a binary search for an element. Circle any elements that will be found by examining two or fewer numbers from the array. #3. Implement the body of the following function using a binary search of the array. You do not need to check the precondition. All your local variables must be size_t variables. bool has_42(const int data[ ], size_t n) // Precondition: The elements data[0]...data[n-1] are sorted from smallest // to largest. The value of n might be zero (indicating an empty // array). // Postcondition: A true return value indicates that the number 42 appears in // data[0]...data[n-1]. A false return value indicates that 42 doesn

Explanation / Answer

8, 4 nd 12 by using selection sort ....... half index number and half of half