When s be a sorted array of n integers, and t(n)denote the time taken for the most efficient algorithm to determine, if there are two elements with sum less than 1000 in s, then which of the following statements is true?
Which of the following shows the correct relationship among some of the more common computing times for algorithms?
The running time of the given code is _______
for (i= 1; i< n; i++)
{
for (j = 1; j < n; j =j⁄2)
{
Print (“Hello”);
}
}
-
Solution
First loop will run n times. Second loop will run log n times both are nested. Hence, its running time is n log n.
What error would the following function gives on compilation?
f (int a, int b)
{
int a;
a= 20;
return = a;
}
Consider the given graph
What is the weight of MST for above graph?
-
Solution
In the circuit shown below with input A= 0, B = 0, the possible logic states C and D are
-
Solution
WhenA = 0
B = 0
Both C and Dare assume to 0
When A = 0,
D = 0,
C = 0,
B = 0,
C = 0,
D = 0It will always give 0, 0 and C and D both.
In 2’s complement addition, overflow
-
Solution
Is the answer, when a + ve value and negative value are added overflow never happens.
How many bits are required to encode all twenty six letters,ten symbols, and ten numerals?
Suppose only one multiplexer and one inverter are allowed to be used to implement any Boolean function of n variables,what is the minimum size of multiplexer needed?
-
Solution
To implement of function of n variables a multiplexer of n–1 select input and 2n–1 data input is required. So the minimum size is 2n–1 to 1 line.
Which of the following boolean algebra expression is incorrect?