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 capital,finance in accountancy??????????
What is diff bet lotus and exchange and which is good in messing only?
How can i send free SMS TO OUR FRNDS?
Hi, i have been selected for abhyudaya clerk interview but dont have the application print out. Will i be allowed for interview?
If i have 3 different company codes,operating in different countries with different currencies so what will be my controlling area currency is it different for all company codes or only one. how will i get consolidated report.
hii,anybody got joining letter in dfo(gd) 2013.PLZZ mail me at rahuldikshit7@gmail.com
hello friends i m from ahmedabad and i have my sbi interview on 4 th may at c g road is there anybody who has the interview on the same day than contect me dear.we will face it together.
what is the meaning of AKALIYAT ?
why dont you join your family business????
what can an interviewer can ask relating the company
The ration of stone,sand and cement in a concrete mixture is 6;3;1.If you have 20m^3 of concrete,what is the volume of;sand,stone and cement?
similarly boy propose girl but in this case girl propose boy?
Is there any minimum marks to be given in SBI clerk interview? My interview was very bad..was able to ans only 10% of questions.I know to read and write the local language.Written have done well. Pls ans if anybody knows the cut off
what were the causes of swadeshi movement?
which is the longest river? plz send on dheeraj22993@gmail.com