@umer - what if the element to be searched is at the middle of the array?
your code doesn't handles this. check out.
On Sat, Oct 6, 2012 at 3:38 AM, icy` wrote:
> nice solution, Dave!
>
> @Umer -- if the sought ele is first, then Dave's code has it sitting in
> the variable temp for a little whi
@umer : also ur code wont work if the searching element is at the middle of
the array...
On Tue, Oct 2, 2012 at 11:43 PM, atul anand wrote:
> @umer : how no. of comparison are reduced to half by moving both
> sidesyou have 2 if condition inside, so you are making 2
> comparisons at each iter