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
doubt
Arnabi
asked
in
Algorithms
Jan 6, 2017
retagged
Jun 27, 2022
by
makhdoom ghaya
391
views
0
votes
0
votes
Given 8 sorted lists, each list of size n/8. If we merge these lists into a single sorted list of n elements, how many comparisons are required in worst case using an efficient algorithm?
How to do this..pls help..
algorithms
sorting
time-complexity
Arnabi
asked
in
Algorithms
Jan 6, 2017
retagged
Jun 27, 2022
by
makhdoom ghaya
by
Arnabi
391
views
answer
comment
Follow
share this
share
2 Comments
by
Krunal2016
commented
Jan 6, 2017
reply
Follow
share this
Shouldn't it be n.log n using merge sort?
0
0
by
Surajit
commented
Jan 9, 2017
reply
Follow
share this
Is it 2 way merge? log 8 * n elements =3n.
0
0
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
2
Answers
0
votes
0
votes
Each pass requires 8(n/8) comparisons i.e. n. A nd the height of the tree is 8. So total time n*log8 i.e (3n)
Avik Pramanick
answered
Jan 7, 2017
by
Avik Pramanick
comment
Follow
share this
0 Comments
Please
log in
or
register
to add a comment.
0
votes
0
votes
total comparisons will be 3n-7 as each time it compaares total-1 max.
so for first time it will form 4 arrays of n/4 total comparissons to reach this is 4*n/4 - 4 for each same for second level 2*n/2-2 n final level n-1 so total is 3n-7
shayal chhabra
answered
Jan 8, 2017
by
shayal chhabra
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
0
votes
0
votes
1
answer
1
tusharb
asked
in
Algorithms
Feb 18, 2022
733
views
Algorithm self doubt
As we know the time complexity of solving the greedy knapsack algorithm depends mainly on the sorting algorithm used, Can we use counting sort as the sorting algorithm to reduce the time complexity to O(n)?
tusharb
asked
in
Algorithms
Feb 18, 2022
by
tusharb
733
views
algorithms
self-doubt
sorting
time-complexity
0
votes
0
votes
3
answers
2
aditi19
asked
in
Algorithms
Oct 6, 2018
1,148
views
Merge Sort Doubt
what is the recurrence relation for merge sort?
aditi19
asked
in
Algorithms
Oct 6, 2018
by
aditi19
1.1k
views
merge-sort
algorithms
time-complexity
recurrence-relation
sorting
divide-and-conquer
0
votes
0
votes
1
answer
3
eyeamgj
asked
in
Algorithms
Aug 25, 2018
511
views
algorithm self doubt
suppose we are given a sorted array ....and we need to extract minimum every tym what is the time complexity?? and what is the tym complexity to delete the minimum ? are they both same ?? and what is the tym complexity to delete an element?
eyeamgj
asked
in
Algorithms
Aug 25, 2018
by
eyeamgj
511
views
algorithms
sorting
time-complexity
0
votes
0
votes
2
answers
4
iamdeepakji
asked
in
Algorithms
Aug 17, 2018
247
views
self doubt
Best and Worst case input for: 1. Selection Sort 2. Insertion Sort 3. Merge Sort 4. Quick Sort 5. Bucket Sort 6. Counting Sort 7. Bubble Sort
iamdeepakji
asked
in
Algorithms
Aug 17, 2018
by
iamdeepakji
247
views
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