@Dave, you are right. MAX Heap is correct for your always 11th position
removal logic.
.........
Satya


On Fri, Dec 24, 2010 at 9:45 PM, Satya <satya...@gmail.com> wrote:

> @Dave, I think you meant* *MIN** Heap here?
>
>
>
>
> On Fri, Dec 24, 2010 at 6:46 PM, Dave <dave_and_da...@juno.com> wrote:
>
>> @Bittu: Using the first 10 numbers, build a max heap. Then add each
>> number into the 11th array position (always the 11th position) and
>> perform the up-heap operation. At the end of the input, discard the
>> 11th number in the heap. The remaining numbers will be the 10 maximum.
>> O(n log k) where n = the number of items in the list and k = the
>> number of maximum items you want.
>>
>> Dave
>>
>> On Dec 24, 3:32 am, bittu <shashank7andr...@gmail.com> wrote:
>> > You Have File of Containing 1 Million Integers You need To Find 10
>> > Maximum Integer Out of Them.How You Will Do That ...what is Time &
>> > space Complexcity of Algorithm that you will use....then optrmize the
>> > solution..
>> >
>> > Constraints- U can't Store Whole File in memory @ one time e.g. if u
>> > will do that gigabyt eof memory may be reuqired so that should be
>> > avoided.
>> >
>> > Regards
>> > Shashank Mani Narayan
>> > Birla Instute of Technology,Mesra
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algoge...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to