Brain games: puzzles, riddles, and logical games.
Users rating Registration FAQ

Puzzles, riddles, logical games, mathematics

www.puzzlesriddles.com on Facebook
 

 
Login:
Password:
Remember?
Change password



1. pretorik - 161
2. markr - 116
3. Gordon Weir - 104
4. mbloomfi - 97
5. Dennis Nazarov - 96
6. zzz123 - 72
7. Srikanta - 56
8. lidSpelunker - 53
9. SAMIH FAHMY - 48
10. jkr - 44


1. denisR, mishik - 236
2. alan, De_Bill - 231
3. dddfff - 228
4. kavfy - 221
5. idler_ - 106
6. akajobe - 94
7. tolstyi - 56
8. STARuK - 42
9. vale - 31
10. xandr - 11



An integer array Puzzles for programmers  Weight: 0 Liked the puzzle: 100% 20.01.2010
I. A large array of integer values is given. All values appear twice except one which appears once. How to find this value using at most O(1) additional variables and browsing through the entire array at most O(1) times.
II. Same, except now exactly two values appear once.
Comments:   6 check your solution  

Please do not post comments containing clues, hints, or anything that might be considered as a hint to others. All such comments will be deleted. If you have a question, you can contact a moderator by clicking the button "Submit your solution".

idler_
 
Rating: 106
Group: Moderators
2011-01-28 19:43:06
Reserved.
zzz123
 
Rating: 72
Group: Members
2011-04-16 02:33:58
is anything else known? (e.g. all the values are sequencial - so if 157 exists, then 156 *must* exist), etc.
zzz123
 
Rating: 72
Group: Members
2011-06-02 02:33:37
should the target algorithm be realistically implementable? (e.g. can I use a PRAM, which is a theoretical construct with unlimited numbers of processors)?
idler_
 
Rating: 106
Group: Moderators
2011-06-18 19:06:31
zzz123 2011-04-16 02:33:58
is anything else known?

No.

zzz123 2011-06-02 02:33:37
should the target algorithm be realistically implementable? (e.g. can I use a PRAM, which is a theoretical construct with unlimited numbers of processors)?

Yes, certainly.
zzz123
 
Rating: 72
Group: Members
2011-08-23 04:45:46
[quote' zzz123 2011-06-02 02:33:37'] should the target algorithm be realistically implementable? (e.g. can I use a PRAM, which is a theoretical construct with unlimited numbers of processors)?[/quote]
Yes, certainly.[/quote]

"yes, it must be implementable", or "yes, you can use PRAMs"? :)
alan
 
Rating: 231
Group: Moderators
2011-09-27 11:57:40
zzz123 2011-08-23 04:45:46
zzz123 2011-06-02 02:33:37
should the target algorithm be realistically implementable? (e.g. can I use a PRAM, which is a theoretical construct with unlimited numbers of processors)?

Yes, certainly.


"yes, it must be implementable", or "yes, you can use PRAMs"? :)

Don't get about PRAMs.
The algorithm has to be implementable. Time of computation will depend on size of the array and number of processors used.



 
Users online 0: administrator -  administrator  moderator -  moderator  VIP user -  VIP user  user -  user
en.braingames.ru © 2006-2010 All Rights Reserved