cpp implementation of Search in Rotated Sorted List