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 the process delete account on it site?

1968


how do i begin my interview with a manufacturer to earn their transportation business ?

2002


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...

1793


My D.O.B is 13/06/1990. How to write date of birth in christian era?

5028


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

2301


I need Telangana state Intermediate second year question papers M.P.C group. Pls Post those asap.

2020


what is meant by nearest specification limit in six sigma?

1963


why you want to quit your current job?

2071


what do you mean the mis report?

2248


what is CRR?

2276


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

2171


Gilt edged market means

2226


Kindly provide me test cases for Compatibility testing for Mobile on diffrent operating systems.

1907


Under which situation you need to create abstract method.

1784


what is the time alloted for objective question in allahbad bank clerical exam.plz answer.

2222