java - Fastest way to find an integer in array of integers without sorting and multithreading -
this question asked before , looked without sorting , multithreading 1 needs iterate through elements. there other idea? java implementation fine
if there no other prerequisites input array, no: have iterate through elements until find 1 looking (thus, in worst , average case o(n)
).
if have else (like heap, search tree or otherwise sorted array) can use smarter , faster techniques, of course (e.g. binary search).
Comments
Post a Comment