TripAdvisor Interview Question
68 Interview Reviews |
Back to all TripAdvisor Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Not Specified at TripAdvisor:
Helpful Question?
Yes |
No
Inappropriate?



0 of 0 people found this helpful
by SteveJackson:
{
int mid = 0;
int start=0,end=0;
mid = (min+max)/2;
if(min<0 || max>sortedData.length)
return -1;
if(element==sortedData[mid])
{
return mid;
}
if(element<sortedData[mid])
mid = findElem(sortedData, element,min,mid);
else
mid = findElem(sortedData, element,mid+1,max);
return mid;
}