Question: X For each question from (4-1) to (4-5), please choose the most suitable item from the ones given in the box below as your answer.

 X For each question from (4-1) to (4-5), please choose the

X For each question from (4-1) to (4-5), please choose the most suitable item from the ones given in the box below as your answer. Note that all the items in the box can be chosen for more than one question. In case that you think none of the items in the box can be used as answer, mark as your answer. (2 points each) (A) 0(1) (B) O(n) (C) OR) (D) Oa") (E) O(n log n) (F) O(log n) (G) O(n-log n) (H) 0(2") Questions (4-1) -(4-5) refer to the following program code: #define Nn (4-1) What is the time complexity of Part A if the #define M values of n and x satisfy n = (x/3)? (4-1). #include int main() { (4-2) Suppose that the value x is less than n and the float Data (N), T; Part B uses Merge Sort Algorithm as y to sort int I, J, K; /* Part A Begins */ the array Data into non-increasing order, then for (I = 0; I Data (I+1]) { sort the array Data into non-decreasing order, T = Data (1); Data [I] = Data (I+1); then what is the time complexity of Part B? Data (I+1) = T; (4-3) } I ++; K++; (4-4) Suppose that the value x is greater than n and if(I > J) (I = 0; J--;} the Part B uses Bubble Sort Algorithm as y to } sort the array Data into non-decreasing order, /* Part A Ends then what is the time complexity of Part B? /* Part B Begins -------- Program code sorting all the elements of (4-5) Suppose that the value x is less than n and the array Data using sorting algorithm y Part B uses Bubble Sort Algorithm as y to sort /* Part B Ends the array Data into non-increasing order, then what is the total time complexity of Part A and } Part B? (4-5)

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!