can find in O(n) if array is sorted
On Nov 18, 2007 9:13 AM, dor [EMAIL PROTECTED] wrote:
You can do it in O(n log(n)) (without extra space). If you can afford
O(T) extra space (where T is the largest number in the array, in
absolute value), you can do it in O(n).
On Nov 17, 3:42 pm,
http://www.moneycosmos.com/?r=321740
--~--~-~--~~~---~--~~
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
Call or Send SMS to any phone anywhere in the world Free! -
http://offr.biz/HLGB7321740QUQKUQA
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
Free cPanel web hosting worth $100 for your Domain! 100 MB Web Space + Email
+ MySQL Database + FTP Access More. 100% Free, No Hidden Fees! -
http://offr.biz/HLHCM321740QUQKUQA
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the
Instantly Turn your Computer into a Super TV. Enjoy iPod, PSP, IPhone,
Movies, Music, MP3, TV Shows! - http://cbnk.biz/HLSTV321740QUQKUQA
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post
Send SMS to India @ 1 Cent / SMS! Packs Start $2 Only -
http://cbnk.biz/HL1CS321740QUQKUQA
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
cant this user be blocked?
On Nov 19, 2007 8:11 PM, Riaz Muhammad [EMAIL PROTECTED] wrote:
Free cPanel web hosting worth $100 for your Domain! 100 MB Web Space +
Email + MySQL Database + FTP Access More. 100% Free, No Hidden Fees! -
http://offr.biz/HLHCM321740QUQKUQA
--
you can do it O(n) time if the input array is sorted.
Find the min and max value of the array and then decide how many
number can be eliminated based if they are greater than X.
This problem get complecated if we consider the integers are +ve as
well as -Ve intergers in an array.
But any way
Heap sort has a function heapify which will build the heap. If you
just modify this heapify algorithm to eliminate the repeated elemenst
it will work in O(nLogn).
Also this will work for any number of repeated elements. you can find
this algo in hte Design analysis and algorithms by Corment in