Ask your own question, for FREE!
Computer Science 22 Online
OpenStudy (anonymous):

write a programming in c to find duplicate from a sorted array and print those numbers

OpenStudy (anonymous):

What have you come up with so far?

OpenStudy (e.mccormick):

Just as hint: the fact it is sorted should make the job much simpler and more obvious on how to implement.

OpenStudy (anonymous):

Since the array is already sorted all the duplicate numbers will be adjacent. So to find those duplicates you need to iterate over the array and on each step keep the value from the previous step. If that value from the previous step is the same that the value at the current step -- you got a duplicate (print it ;) if it's different, the there is no duplicate.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!