Question
Consider the divide-and-conquer approach -- MergeSort for sorting array with size m = 2^n. For each iteration, you Divide: Divide the problem into 2 halves.
Consider the divide-and-conquer approach -- MergeSort for sorting array with size m = 2^n. For each iteration, you
Divide: Divide the problem into 2 halves.
Conquer: Sort the two divided arrays using MergeSort recursively. If the arrays are of size 1,
Combine: Merge the sorted halves into a single array.
How many times will you perform the divide step in the procedure for the given array? (Each division into two sub-problems counts as 1.)
Select one:
a. n
b. (2^n)-1
c. 2^n
d. 2^(n-1)
What is the depth of the tree for the following recurrence relation :
T(n) = T(n/2) + (n)
(Give the closest answer)
Select one:
a. n
b. n / 2
c. log(n) + 1
d. 2 * n
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started