Thanks Dave, Don and all others for this clarification.
On Mon, Dec 12, 2011 at 11:23 PM, Prakash D cegprak...@gmail.com wrote:
only the number of comparisons is log(n)
On Mon, Dec 12, 2011 at 11:04 PM, Ankur Garg ankurga...@gmail.com wrote:
Agree with dave..Its still O(n)
On Mon, Dec
I think...
First round of tournament sort. :D
On Mon, Dec 12, 2011 at 8:02 AM, sagar pareek sagarpar...@gmail.com wrote:
Hi every one.
Can we find largest number from an unsorted array in log(n) ?
--
**Regards
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD
--
Yes Mr. DoN
First round of Tournament sort results in log(n) time for finding largest
no.
n/2+n/4+n/8 results n/(2^i) where ^ = power
On Mon, Dec 12, 2011 at 8:16 AM, Don dondod...@gmail.com wrote:
No. To find the largest number in an unsorted array requires looking
at
@Sagar: Don is correct. n/2+n/4+n/8+... ~= n. But even the first
round, involving n/2 comparisons, is O(n).
Dave
On Dec 12, 11:23 am, sagar pareek sagarpar...@gmail.com wrote:
Yes Mr. DoN
First round of Tournament sort results in log(n) time for finding largest
no.
n/2+n/4+n/8
Agree with dave..Its still O(n)
On Mon, Dec 12, 2011 at 10:57 PM, Dave dave_and_da...@juno.com wrote:
@Sagar: Don is correct. n/2+n/4+n/8+... ~= n. But even the first
round, involving n/2 comparisons, is O(n).
Dave
On Dec 12, 11:23 am, sagar pareek sagarpar...@gmail.com wrote:
Yes Mr.
apply MAXHEAPIFY on root ode and extract the root node
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
Max Heapify is O(n).
On Mon, Dec 12, 2011 at 11:43 PM, ankit gupta ankit.itc...@gmail.comwrote:
apply MAXHEAPIFY on root ode and extract the root node
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
maxheapify is lg(n)..check coremen
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For
http://www.cse.iitk.ac.in/users/dsrkg/cs210/applets/sorting/heapSort/heapSort.html
for reference
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group,
^it cant get better than O(n) apparently. Just applying max-heapify once
would not yield the max element. You need to construct a heap for it, which
is no less than O(n).
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
Exactly. Really you should see this with almost no thought. It's
called an adversary argument and goes like this.
Since you don't know the order of elements in A, envision them as
being put in order by an adversary that always knows in advance what
element you're going to examine next. Now no
By Max Heapify I thought u meant to say u are making a Max Heap .. In case
you use Coreman Definition Of max Heapify it just heapifies assuming the
heap has been formed, But u need to make a max Heap first dude :)
P.S- Clarify your concepts before posting the link :(
On Tue, Dec 13, 2011 at
@all..Well I am no expert but my logic says its impossible to pick the best
unless and untill you look at each and every individual.Isn't this logic
enough?
On Tue, Dec 13, 2011 at 12:32 AM, Ankur Garg ankurga...@gmail.com wrote:
By Max Heapify I thought u meant to say u are making a Max Heap
only the number of comparisons is log(n)
On Mon, Dec 12, 2011 at 11:04 PM, Ankur Garg ankurga...@gmail.com wrote:
Agree with dave..Its still O(n)
On Mon, Dec 12, 2011 at 10:57 PM, Dave dave_and_da...@juno.com wrote:
@Sagar: Don is correct. n/2+n/4+n/8+... ~= n. But even the first
round,
14 matches
Mail list logo