# About the "Finding Values in an Array" tutorial

**URL:** <https://forum.kirupa.com/t/about-the-finding-values-in-an-array-tutorial/177681>\
**Category:** flash\
**Created:** [February 4, 2006, 12:57am UTC](https://forum.kirupa.com/t/about-the-finding-values-in-an-array-tutorial/177681 "2006-02-04T00:57:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joaodelima](https://avatars.discourse-cdn.com/v4/letter/j/6f9a4e/32.png) [@joaodelima](https://forum.kirupa.com/u/joaodelima)\
**Post date:** [February 4, 2006, 12:57am UTC](https://forum.kirupa.com/t/about-the-finding-values-in-an-array-tutorial/177681/1 "2006-02-04T00:57:29Z")

</div>

I just read the tutorial “Finding Values in an Array”. Sure, the code works, but that’s only because we are searching arrays the contain a small number of elements.

Suppose we have n elements in an array. To search that array for a particular element we may have to do n comparisons.

If the array we are searching contains 10 million elements, we have a problem; can you imagine doing “if (this == that)” 10 million times?

There’s got to be a better way to search the array. Or perhaps we shouldn’t use arrays to store the information.

Anybody has any ideas?
