Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  In a modified merge sort, the input array is ... Start Learning for Free
In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?
  • a)
    N(logN base 3)
  • b)
    N(logN base 2/3)
  • c)
    N(logN base 1/3)
  • d)
    N(logN base 3/2)
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
In a modified merge sort, the input array is splitted at a position on...
The time complexity is given by: T(N) = T(N/3) + T(2N/3) + N Solving the above recurrence relation gives, T(N) = N(logN base 3/2)
View all questions of this test
Most Upvoted Answer
In a modified merge sort, the input array is splitted at a position on...
Explanation:

In a modified merge sort, the input array is split at a position one-third of the length(N) of the array. This means that at each level of recursion, the array is divided into three subarrays of approximately equal size.

Time Complexity of Merge Sort:
In a standard merge sort algorithm, the time complexity is given by O(NlogN), where N is the size of the array.

Analysis of Modified Merge Sort:
In the modified merge sort, the input array is split into three subarrays of approximately equal size. Let's denote the size of the array as N.

At each level of recursion, the array is divided into three subarrays of size N/3. The merge sort algorithm is then applied to these subarrays.

Number of Levels:
The number of levels in the recursion tree can be determined by finding the height of the tree. At each level, the size of the array is divided by 3.

The number of levels (h) can be calculated as follows:
N/(3^h) = 1 (when the array is divided into subarrays of size 1)
N = 3^h
Taking logarithm base 3 on both sides:
log3(N) = log3(3^h)
log3(N) = h

So, the height of the recursion tree is log3(N).

Number of Subproblems:
At each level of recursion, the array is divided into three subarrays. So, the number of subproblems at each level is 3.

Time Complexity Calculation:
To calculate the time complexity, we need to consider the number of levels and the number of subproblems at each level.

At each level, there are 3 subproblems, and the total number of levels is log3(N).

So, the time complexity can be calculated as:
3^0 + 3^1 + 3^2 + ... + 3^(log3(N))

Using the formula for the sum of a geometric series, we can simplify this expression:

3^0 + 3^1 + 3^2 + ... + 3^(log3(N)) = (3^(log3(N)+1) - 1) / (3 - 1)
= (3 * 3^(log3(N)) - 1) / 2
= (3 * N - 1) / 2

Therefore, the worst-case time complexity of this modified merge sort is O(N).

Conclusion:
The worst-case time complexity of the modified merge sort, where the input array is split at a position one-third of the length(N) of the array, is N(logN base 3/2).
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?a)N(logN base 3)b)N(logN base 2/3)c)N(logN base 1/3)d)N(logN base 3/2)Correct answer is option 'D'. Can you explain this answer?
Question Description
In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?a)N(logN base 3)b)N(logN base 2/3)c)N(logN base 1/3)d)N(logN base 3/2)Correct answer is option 'D'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared according to the Computer Science Engineering (CSE) exam syllabus. Information about In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?a)N(logN base 3)b)N(logN base 2/3)c)N(logN base 1/3)d)N(logN base 3/2)Correct answer is option 'D'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?a)N(logN base 3)b)N(logN base 2/3)c)N(logN base 1/3)d)N(logN base 3/2)Correct answer is option 'D'. Can you explain this answer?.
Solutions for In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?a)N(logN base 3)b)N(logN base 2/3)c)N(logN base 1/3)d)N(logN base 3/2)Correct answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for Computer Science Engineering (CSE). Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) Exam by signing up for free.
Here you can find the meaning of In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?a)N(logN base 3)b)N(logN base 2/3)c)N(logN base 1/3)d)N(logN base 3/2)Correct answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?a)N(logN base 3)b)N(logN base 2/3)c)N(logN base 1/3)d)N(logN base 3/2)Correct answer is option 'D'. Can you explain this answer?, a detailed solution for In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?a)N(logN base 3)b)N(logN base 2/3)c)N(logN base 1/3)d)N(logN base 3/2)Correct answer is option 'D'. Can you explain this answer? has been provided alongside types of In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?a)N(logN base 3)b)N(logN base 2/3)c)N(logN base 1/3)d)N(logN base 3/2)Correct answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice In a modified merge sort, the input array is splitted at a position one-third of the length(N) of the array. What is the worst case time complexity of this merge sort?a)N(logN base 3)b)N(logN base 2/3)c)N(logN base 1/3)d)N(logN base 3/2)Correct answer is option 'D'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev