Code For NonGeek
Would you like to react to this message? Create an account in a few clicks or log in to continue.

An array of integers, all appear twice except one, find this number.

Go down

 An array of integers, all appear twice except one, find this number. Empty An array of integers, all appear twice except one, find this number.

Post  viterbi Tue Sep 13, 2011 10:00 am

1____int unique_number(int a[], int l) {
2__________int q = a[0];
3__________for (int i=1; i<l; i++) q = q^a[i];
4__________return q;
5____}

viterbi

Posts : 32
Join date : 2011-09-03

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum