i am getting WA in this Prob . According to myself the problem statement is some thing like this :
[cpp]YOU R GIVEN A LIST OF NON DECREASING SORTED NUMBER . AND AS AN INPUT A NUMBER WILL BE GIVEN , U HAVE TO FIND OUT THE LARGEST NUMBER SMALLER THAN THE SPECIFIED NUMBER AND THE SMALLEST NUMBER LARGEST THAN THAT NUMBER (SPECIFIED NUMBER).[/cpp]
i used Binary Search to Solve This Prob . Here is my code , can some one plizzzzzzzzzzz check the code for me , and tell me what is wrong with it .
more over i considered the input :
and my output is :4
1 2 3 4
5
5 0 3 1 4
i guess this r the cases which i should be considering ..4 X
X 1
2 4
X 2
3 X
[cpp]
**********************CODE REMOVED************************
[/cpp]
Riyad