Posted by Willem Bogaerts on 03/30/07 07:35
> one of my friends faced the following question at an interview:
>
> Which method will you follow to search a record from a million records
> in an array?
>
> Please help
Well, that depends, off course (that is why it is a nice question for an
interview).
If the array is sorted and the keys are numeric and all present, you can
write a binary search routine. Otherwise, there are built-in functions
that let you search both keys and values.
Best regards
--
Willem Bogaerts
Application smith
Kratz B.V.
http://www.kratz.nl/
[Back to original message]
|