Question: Given an element with index i in the array - representation of a heap, which of the following correctly computes the index of the left
Given an element with index in the arrayrepresentation of a heap, which of the following correctly computes the index of the left child of that element?
a
b
c
d
e
What is the runningtime as a tight bigO bound of restoring the heaporder of a heap after a deleteMax operation?
a
b
c
d
e
For the interval scheduling problem, which greedy paradigm produces an optimal solution?
a the shortest jobs
b the job with the fewest conflicts
c the job with the earliest starting time
d the job with the earliest ending time
e none of the above
What is the bestcase running time as a tight bigO bound for quicksort to sort an array of elements?
a
b
c
d
e
Merge Sort makes two recursive calls. Which statement is true after these recursive calls finish, but before the merge step?
a The array elements form a heap.
b Elements in each half of the array are sorted amongst themselves.
c Elements in the first half of the array are less than or equal to elements in the second half of the array.
d Both a and b are true.
d None of the above.
Suppose you have coins of denominations and You use a greedy algorithm, in which you choose the largest denomination coin which is not greater than the remaining sum. For which of the following sums, will the algorithm NOT produce an optimal answer?
a
b
c
d
e
Median of three quick sort is an inplace sort.
ALWAYS
SOMETIMES
NEVER
For the fractional knapsack problem, being greedy on the item with the smallest weight yields an optimal solution.
ALWAYS
SOMETIMES
NEVER
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
