>  If the array may or may not contain the majority element, then after the
> last step(ie once you get the get the array with one element) , just iterate
> thru the original array once counting the number of occurences of this
> element.
This along with karthik's logic works perfect. And it does not take
nlogn time. In fact it takes O(N) time.
>
>
>  >
>

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to