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
When will axis bank announce the result of exam held on 20th june 2010 of western zone?
which type of growth do you want?
Difference between Windows Vista and Windows XP professional?
is there any jobs for 15 year olds?
How to set tracing level for PowerCenter Informatica. Do we need to give tracing level in each and every mapping or is there any option to change tracing level commonly for all mappings. ?
How much amount we have to pay octroi Charges for food items in Hyderabad
iam getting offers for back door process .form the comapanies medhasolutions,lanticsolutions,precessglobal.inc(banglore) cybate commitment 1 lakh salary 1.44per annum mind tech soft commitment 90000rs salary 1.44per annum profilent commitment 90000rs salary 1.80per annum config commitment 70000rs salary 1.20per annum v one infotech commitment 1 lakh salary 1.44per annum finch commitment 90000rs salary 1.44per annum bin soft tech commitment 1.20 lakh salary 2.40per annum impact commitment 1 lakh salary 2.44per annum jkl consol commitment 1 lakh salary 1.8 - 2.4per annum oligoi solutions commitment 1lakh 2.64 per annum plz tell me which one to beleve if any one know details plz send me msg @9885090595
I am selected as DEO IN kerla cag anybody wants mutual transfer i want in northern india Like up delhi punjab etc Call me 7275639235 7275219235
what is the intention of Central excise act for making diff betn production and manufacture?
WHY DO YOU WANT TO JOIN AS CLERK IN BANK AFTER M.SC IN BIOTECHOLOGY
What is the most difficult situation you have ever faced in your life?
Dear All, If employee completed his/her probation period for 6 month and still continued, we can terminated him because he was misbehave with Director of the company or employee registered the complaint in labor court for compensation? Shazia Muzaffar
why assay by HPLC as per USP is necessary in testing if assay by potentiometry as per EP is already analysed un stability study
please tell me what type of question ask in back office interview.
Tel me da fee structure of RACE?