Given int numbers [8] = {15, 27, 36, 49, 62, 75, 83, 96}, and the target v and t
ID: 3854797 • Letter: G
Question
Given int numbers [8] = {15, 27, 36, 49, 62, 75, 83, 96}, and the target v and the target value of 83, assuming that binary search is used, list the values of all the array elements which will be compared with 83, in the order in which they will be compared, before binary search concludes that will be 83 occurs in the array? How many elements compared with 83: ___ Value of first element compared with 83: _____ Value of second element compared with 83: ____ Value of third element compared with 83: __ Values of other elements compared with 83, if any ____ Assuming the declaration for a structure named FUN as given below, write C code to declare an array named my_fun of size 20, each of whose elements is of type FUN. typedef struct { char* x char y int z[200]: FUN: The required declaration: _____ A sorting algorithm is used to sort an int array with initial contents as shown below After two passes of the sorting algorithm are executed, the array contents are in increasing order, as shown below Name of the sorting algorithm used is: _____Explanation / Answer
48. Ans: 3 elements will be compared with 83
At first time 49
Second time 75
Third time 83
83 will be compared to itself
=============================================================================
49.Ans: FUN my_fun[20];
=============================================================================
50 Ans: Selection Sort
Given elements 50 40 30 20 10
At first stage swap small element with large we have -> 10 40 30 20 50 now unsorted elements are 40 30 20
now again swap small with highest one we have-> 10 20 30 40 50
=============================================================================
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.