H
Hendrik Maryns
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message
(e-mail address removed) schreef:
And how does it work?
I have this little idea, it relies on the fact that the array is filled
with the numbers from 1 to 1000. Maybe this is enough of a tip?
It stops as soon as the double number is found. Which of course can be
the last one accessed, if one is unlucky.
Another hint: take care for numbers which are stored in the slot they
refer to.
H.
--
Hendrik Maryns
==================
www.lieverleven.be
http://aouw.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFEIt9Ve+7xMGD3itQRArC4AJ9/l8f/fRdHkj4AsyDlSjG+jDYzHgCfXbNn
DsK8M0AEb44XCKlSbKagh18=
=biCm
-----END PGP SIGNATURE-----
Hash: SHA1
NotDashEscaped: You need GnuPG to verify this message
(e-mail address removed) schreef:
Hi,
the solution without extra storage that I've got involve accessing each
and every element in the array (only once, as stated in the problem).
And how does it work?
Hower using extra-storage (like, say, 1000 bits) the search could
usually stop way before reaching the end.
Indeed.
Is your solution without extra-storage similar (in that it needs to
access every element)?
I have this little idea, it relies on the fact that the array is filled
with the numbers from 1 to 1000. Maybe this is enough of a tip?
It stops as soon as the double number is found. Which of course can be
the last one accessed, if one is unlucky.
Another hint: take care for numbers which are stored in the slot they
refer to.
H.
--
Hendrik Maryns
==================
www.lieverleven.be
http://aouw.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
iD8DBQFEIt9Ve+7xMGD3itQRArC4AJ9/l8f/fRdHkj4AsyDlSjG+jDYzHgCfXbNn
DsK8M0AEb44XCKlSbKagh18=
=biCm
-----END PGP SIGNATURE-----