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 problems do you faced at work? ( apply for condominium admin staff post )

1526


hi, i've cleared union bank of india's clerical cadre written exam. and called for interview on 18th of this month. I dont have the copy of fee payment challan and print out of online application. whether these things are very important or not?

1925


sir, i completed my diploma at 2009,den i joined in a degree course but i didnt completed my btech due to some problem.so now 2012, dat means three years gap.i want a job in it sector.but in most companies,they want btech candidate.so wat type of problem'll come if i produce fake btech critificate???? they'll varify my qualification? and wat'll happen if they found my critificate's r false after getting job?

1797


Why Amartya sen got Nobel prize? how his theory proved useful for developing nations?

1864


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

4967


sir, when will start the new batch for group2 coaching... pls kindly inform me.......

1833


which is the best engineering college in vijayawada

2391


I heard about online data entry job and is this job safe, legal to do at home. How I will find a good online job to do at home ?

1838


what is CRR?

2217


Q.1)IM A UK BORN PERSON. NOW IM MARRIED AND HAVE TWO KIDS THAT HOLD PAKISTANI NATIONALITY.NOW I WANT TO APPLY FOR UK VISIT VISA.WHAT ARE THE REUIREMENTS THAT ARE NEEDED TO BE FULFILLED FOR THE VISA?

1939


hi im studing in MCA final yr. Now i need to do project. im more intrested on web... can any one suggest me which will be better 1 n more easy to do. As i dont know wht is the meaning of project atleast... n im very teens... so plz help me out....

2047


hi friends hey i need a help. i m doin my 6thsem(B.E) i need to do a project on opengl(graphics). so can u please suggest me some good topics for my project.M NOT GETTIN ANY IDEA OF WAT TO DO. PLEASE INFORM ME as soon as possible. it shud be simple and innovative.

1725


hi friends, i completed MCA and searching for software jobs. but i cleared SBI clerical written and called for interview. at this time what is better? joining as clerk in SBI or to wait for some time and getting a job as a s/w engg ? please suggest me. will there be career growth in SBI?

2023


HI ANYONE GET OFFER LETTER WHO ATTEND THE IBM GURGAON INTERVIEW ON 22ND AUG 2010 ON ORACLE DBA

2546


what is the type of supply((AC or DC) used to HT motors?

1800