The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+2 votes
77 views

I think its none of the above?

asked in Algorithms by (307 points) | 77 views
0
I think option C ..
0

how is that??

Isnt it mlog(n+m).

0
If it's option C I can tell you my approach..what is the answer given?
0
Given as C
+3
Okay..since they said that the elements are not inserted one by one so we can think like all the elements are added together.
Heap uses array data structure right..so append those m elements after n elements.
Now total size of heap is m+n. Apply build heap on it.
You answer would have been correct if the elements were added one by one.
+1
Got it now.Thnks :)

Please log in or register to answer this question.

Related questions



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

47,003 questions
51,322 answers
177,489 comments
66,667 users