(A) sorted
(B) unsorted
(C) unchanged
(D) same
Tag: Fundamentals of Computer Algorithms
Define the __of an element to be one plus the number of elements that are smaller.
(A) Rank
(B) Degree
(C) NA
(D) NA
MERGE-SORT( array A, int p, int r) 1 if (p < r) 2 then 3 q ← (p + r)/2 4 MERGE-SORT(A, p, q) // sort A[p..q] 5 MERGE-SORT(A, q + 1, r) // sort A[q + 1..r] 6 MERGE(A, p, q, r) // merge the two pieces?
(A) True
(B) False
(C) NAN
(D) NA
The merge sort algorithm works by __.
(A) ivide: split down the middle into two subsequences, each of size roughly n/2
(B) Conquer: sort each subsequence by calling merge sort recursively on each
(C) Combine: merge the two sorted subsequences into a single sorted list
(D) All of the above
The main elements to a divide-and-conquer solution are__.
(A) Divide: the problem into a small number of pieces
(B) Conquer: solve each piece by applying divide and conquer to it recursively
(C) Combine: the pieces together into a global solution
(D) All of the above
Ancient Roman politicians followed an important principle of good algorithm design known as Divide and Conquer Strategy?
(A) True
(B) False
(C) NA
(D) NA
Upper bound f(n) grows no faster asymptotically than n^2?
(A) True
(B) False
(C) NA
(D) NA
Lower bound f(n) = 8n2 + 2n − 3 grows asymptotically at least as fast as n^2.
(A) True
(B) False
(C) NA
(D) NA