What is not ideal? If it is search, then you can employ binary search. If the array count is 1000, worst case scenario is number of loop is only 10 (vs 1000 if linear search).
What is not ideal? If it is search, then you can employ binary search. If the array count is 1000, worst case scenario is number of loop is only 10 (vs 1000 if linear search).