search in almost sorted array