U have an array of +ve integers arranged in the descending
order . Write a functionb thast take an integer & an integer
array as an integer and returns the position of the given
integer in the array , if the integer is not present in the
array it should return -1 . the serching technique that u
use should be very efficient both in terms of time & memory.
Answer Posted / argho
function desc
begin
Ineger i;
Array a[n];
x=1;
y=n;
1. for k=1 , loop from x to y while array[n] / 2;
temp[a]= a[n]/2
if temp[a] < i
call step 1 with argument x=1 y=n/2
else if temp[a] > i
call step 1 with argument x=(n/2)+1 y=n
else
return position
end
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
what is the process delete account on it site?
how do i begin my interview with a manufacturer to earn their transportation business ?
I have done MBA(Finance & Mktng) back in 2009 and then join the BPO backend process for 1 year and done sap sd and now i m lkking for the sap sd or mba job ..please reply fast at lalit.chitkara@gmail.com if you have any suggestion...i need job immediatly...
My D.O.B is 13/06/1990. How to write date of birth in christian era?
Which one of the following natural region is known as the 'Bread Basket' of the world? 1. Steppe region 2. Mediterranean region 3. Mansoon region 4. Equatorial region
I need Telangana state Intermediate second year question papers M.P.C group. Pls Post those asap.
what is meant by nearest specification limit in six sigma?
why you want to quit your current job?
what do you mean the mis report?
what is CRR?
i entered singapore on 16th october 2009. but i was refused to enter singapore on the airport. when i asked him he dint answered me.by now my visa is expired and i wanna know the reason of my entry rejection in india
Gilt edged market means
Kindly provide me test cases for Compatibility testing for Mobile on diffrent operating systems.
Under which situation you need to create abstract method.
what is the time alloted for objective question in allahbad bank clerical exam.plz answer.