Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Merge Sort Doubt
aditi19
asked
in
Algorithms
Oct 6, 2018
1,144
views
0
votes
0
votes
what is the recurrence relation for merge sort?
merge-sort
algorithms
time-complexity
recurrence-relation
sorting
divide-and-conquer
aditi19
asked
in
Algorithms
Oct 6, 2018
by
aditi19
1.1k
views
answer
comment
Follow
share this
share
1 comment
by
MiNiPanda
commented
Oct 6, 2018
reply
Follow
share this
T(n)= 2T(n/2) +Theta(n)
1
1
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
3
Answers
0
votes
0
votes
First merge sort for half array(1to m) that takes T(n/2)
Second merge sort for last half array(m+1to n)
Final phase merging them in O(n) time
So total time complexity=2T(n/2)+O(n/2)
=O(nlogn)
Ram Swaroop
answered
Mar 15, 2019
by
Ram Swaroop
comment
Follow
share this
0 Comments
Please
log in
or
register
to add a comment.
0
votes
0
votes
Reccurrence relation for merge sort is T(n)=2T(n/2)+O(n)
Sanandan
answered
Sep 12, 2020
by
Sanandan
comment
Follow
share this
0 Comments
Please
log in
or
register
to add a comment.
0
votes
0
votes
T(n) =2T(n/2) + O(n)
T(1) = 1
Because in mergesort function we call two time mergesort and at last
we call merge procedure , merge procedure take O(n) and each time we
divide array in half .
Aniket1710
answered
Jul 10, 2023
by
Aniket1710
comment
Follow
share this
0 Comments
Please
log in
or
register
to add a comment.
← Previous
Next →
← Previous in category
Next in category →
Related questions
1
vote
1
vote
1
answer
1
rahul sharma 5
asked
in
Algorithms
Mar 9, 2018
1,317
views
Merge sort algorithm
Consider the modified merge sort where we divide array into 5 equal sub arrays instead if 2(as in standard merge sort).What is the time complexity if modified merge sort? Is there any improvement over standard merge sort?
rahul sharma 5
asked
in
Algorithms
Mar 9, 2018
by
rahul sharma 5
1.3k
views
algorithms
merge-sort
sorting
time-complexity
1
vote
1
vote
0
answers
2
Parshu gate
asked
in
Algorithms
Nov 20, 2017
847
views
Merge sort and insertion sort
Parshu gate
asked
in
Algorithms
Nov 20, 2017
by
Parshu gate
847
views
algorithms
sorting
merge-sort
time-complexity
0
votes
0
votes
0
answers
3
learner_geek
asked
in
Algorithms
Oct 28, 2017
590
views
MERGE SORT
IS 2 way merge sort and normal merge sort is same.in which we have to use bottom-up merging approach by taking 2-2 element inside the list.if 5-way merge sort then in the list we have to take 5-5 elements from bottom to up for merging. if I am wrong please let me correct!
learner_geek
asked
in
Algorithms
Oct 28, 2017
by
learner_geek
590
views
merge-sort
algorithms
sorting
time-complexity
4
votes
4
votes
1
answer
4
Shivi rao
asked
in
DS
Oct 10, 2017
1,531
views
Merge sort
True or False Merge sort on Linked list takes O(nlogn)
Shivi rao
asked
in
DS
Oct 10, 2017
by
Shivi rao
1.5k
views
merge-sort
algorithms
sorting
time-complexity
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(25)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(684)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
244k
comments
80.0k
users
Recent Blog Comments
category ?
Hi @Arjun sir, I have obtained a score of 591 in ...
download here
Can you please tell about IIT-H mtech CSE self...
Please add your admission queries here:...
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy