searches an element of array using linear search algorithm