The Gateway to Computer Science Excellence
+1 vote
100 views

Plzzz explain...

in Algorithms by Junior (693 points) | 100 views
0
Is it C Option?
0
No...A is given as a answer,
0
Only two option looking best A and C , so chooses C .

Okk but A is answer my reason regarding A is using built heap you can got O(n)
+1
Ok...thanku...bro!
0
answer is O(m+n) since m can be , m>>>>n. then time will be O(m) not O(n).
0
Can u explain how it is O(m+n)
0
@Anu

and if m<<n

A) will be ans

and also say m=1

we can O(n+1)=O(n)
+1
and @srestha

why are you assuming m<n ?

O(m+n) is best option, it will satisfy either if m<n or n<m , but O(n) is not correct if m>n
0
Sir can you explain reason behind O(m+n)
0
@Chirag,

O(m+n) is a time complexity to apply build heap on m+n elements.
0
Sir can you give link for build heap..
0

see this

0

@nitish

Not necessarily one after another

If this was not mentioned in the question. We would take this as inserting each element individually, and its complexity would have been O(mlogn),? 

0
yes....

Please log in or register to answer this question.

No related questions found

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
50,737 questions
57,385 answers
198,559 comments
105,383 users