Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

what is capital,finance in accountancy??????????

1977


What is diff bet lotus and exchange and which is good in messing only?

2229


How can i send free SMS TO OUR FRNDS?

1826


Hi, i have been selected for abhyudaya clerk interview but dont have the application print out. Will i be allowed for interview?

2233


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.

2103


hii,anybody got joining letter in dfo(gd) 2013.PLZZ mail me at rahuldikshit7@gmail.com

1898


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.

1962


what is the meaning of AKALIYAT ?

3703


why dont you join your family business????

4371


what can an interviewer can ask relating the company

2118


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?

1536


similarly boy propose girl but in this case girl propose boy?

1603


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

1873


what were the causes of swadeshi movement?

4672


which is the longest river? plz send on dheeraj22993@gmail.com

1883