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

WCT not deducted from contract value but contractor paid full VAT is it right

1602


Do any one know online jobs to earn money. If Yes, please provide me with those details which helps me to take care of family since, they are depending only me.

2041


where did the name "cat" come from?

2228


is there any company in India where you can earn money from home by doing job online

1811


what % of education in pakistan 2011?

1847


hi i m ashu , i am selectd in sbi interview 2010 plz guys suggest me how to prepare for that...........

2166


A boy asked a girl her name then she told him that her name is 6,12,16,23,19,3 then what is her name?

2041


iwant to join testing in mind q.is there any new batch will start for testing? i heard that nageswarao is not in mindq he started another institute which one is better? i also want to know the fee deails & duration of the course.

2950


Hire Purchase System and Installments System.

1941


name the sikkim state bird?

3784


Could u tell the the best govt exam coaching institutes for banking and ssc near gachibowli?

1899


= 5, b = 1, x = 10, and y = 5, create a program that outputs the result of the formula f = (a – b) (x – y) using a signal printf () function.

3304


describe yourself...

2025


in oracle apps technical which module is best for MCA students

2130


hello, how it is possible as you replied my id i was selected the indian bank clerical exam!!!!!!!!! hmmm. ok if i selected means, send me the result link website.. i will search and tell to thanks for you.. ok

1901