You can refer the following algorithm Let the elements be in the form of an array A[1...N] 1. Sort all the elements of A(This can take at least O(n) time). 2. For i=1 to N, do:
while( ( i+1 <= N) AND (A[i] == A[i+1]) ) remove A[i+1]. 3. END -- 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.