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
i had an backlog in my engg finial year.so i am counted as 2008 or 2009 passout for applying to IT companies? so what should i keep it in my resume thanks in advance.
is there any company in India where you can earn money from home by doing job online
similarly boy propose girl but in this case girl propose boy?
Brief me about plug and play technology?
i m from engineering background and now i want to go banks....if the question will asked that why u prefer the bank job while u r from technical background?
When Dena Bank po 2017 will be held????
Can you tell me which coaching classes is best for banking in chennai?
Why only sulphuric caid used in residue on ignition, not other acids.what is its special property
Thyristor convertor type AVR(Automatic Voltage Regulator) is made of Thyristors(Silicon Controlled Rectifiers,SCRs). We know that output DC voltage from an SCR will not only depend upon the r.m.s. value of Input voltage applied, but also at the angle at which the input AC cycle is fired (using gate signal). If the firing angle is zero(in a simple circuit), then maximum DC output voltage will be obtained.If the firing angle is changed from 0 to 180,then maximum to minimum voltage is obtained. This property could be used to build an AVR. The firing angle proportional to Output voltage could be used to trigger the thyristor,in a closed loop manner and a nearly constant DC voltage(Average Value) can be obtained.An invertor circuitory could be utilised to get a regulated AC supply. Many other configurations can be build from thyristors to get a regulated AC supply.
Who is the best football player in the world?
I want sylabs of cleark test of H A U HISAR
What. Is. This sap mining
sometimes when we touch other person's hand we feel a minor (current like) shock, why so?
waht is your srength and weakness?
what sort of trainings would benefit you in the next year? not just job skill but also your natural strength and personal passion