added basic binary search and general version which support rotated
array.