Possible Duplicate:
remove duplicate elements in an array in O(n) in C/C++
How can I remove duplicate elements from an array?
Before
array [ ] = {1,2,3,4,5,1,2,4,9,0,0}
After
array [ ] = {0,1,2,3,4,5,9}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sort the array using your favorite sorting algorithm.
Walk through the array and eliminate duplicates – if a value is the same one as the previous one, keep going forward until you get a new value and then copy it back.