Make it parallel. Divide the array in chunks and search in parallel.
The complexity will be O(n) but running time will be much less. Actually it will be proportional to no. of processors you have.
You can use Parallel Patterns Library in C++
Make it parallel. Divide the array in chunks and search in parallel.
The complexity will be O(n) but running time will be much less. Actually it will be proportional to no. of processors you have.
You can use Parallel Patterns Library in C++