Instead of arrays we can use BST to store the numbers, in which case this problem can be solved in O(n log n). Garcia, your algo is not O(n) as deleting an element in the array itself is O(n) and you are deleting n-1 array elements. I think better than O(n logn) is not possible but can't think of a proof.
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---
