Data Structure and Algorithm Analysis
Questions 31 to 40
31.
|
In
analysis of algorithm, approximate relationship between the size of the job
and the amount of work required to do is expressed by using _________
(a) Central tendency
(b)
Differential equation
(c) Order of execution (d) Order of magnitude
(e) Order of Storage.
|
32.
|
Pick the
correct prefix form to the given infix expression
{a*[b/(c-d)*f]/g}/[e+h]
(a) //*a/b*-cdfg+ch (b) abcd-f*/g/*eh+/
(c) //*a*/b-cdfg+eh (d) //*ab*/-cdfg+eh
(e) -//*a*/bcdfg+eh.
|
33.
|
For
recursive MinMax algorithm, the average, worst cases are __________
(a) (b)
(c) (d)
(e)
|
34.
|
P, Q and
R are pointer variables. The statements below are intended to swap the
contents of the nodes pointed to by P and Q. rewrite it so that it will work
as intended.
P = Q; R = Q; Q = R;
(a) R=Q;
P=R; Q=R; (b) R=P;
P=P; Q=Q;
(c) P=P;
P=Q; R=Q; (d) R=P;
P=Q; Q=R;
(e) P=R;
R=Q; Q=R;
|
35.
|
For
defining the best time complexity, let f (n) = log n and g (n) = √n,
_________
(a) f (n) ÎΩ(g(n)), but g(n) Ï Ω (f(n)) (b) f (n) ÏΩ(g(n)), but g(n) Î Ω (f(n))
(c) f (n) ÏΩ(g(n)), and g(n) Ï Ω (f(n)) (d) f (n) ÎΩ(g(n)), and g(n) Î Ω (f(n))
(e) Can’t be defined for best case.
|
36.
|
If f, r
are the front, rear pointers respectively in a circular queue then the
condition (( f – r + size) % size ==
1) && ( (f != 0) || (r != -1) ) represents
(a) Queue
has only one element (b) Two Elements
(c) More than 2 elements but not full (d) Impossible values
(e) Queue
is full.
|
37.
|
For the
following two statements, choose the correct answer.
I. n2ÎO(n3).
II. n = θ ((n+1)!).
(a) (I) and (II) are TRUE
(b) (I), (II) are FALSE
(c) (I) is FALSE, but (II) is TRUE
(d) (I) is TRUE and (II) is FALSE
(e) (I) is TRUE but (II) can’t be defined.
|
38.
|
The
statement head->Link->Link->Link = NULL terminates a linked list
after its __________ node.
(a) 2nd (b) 4th (c) 5th (d) 3rd
(e) first.
|
39.
|
For
analyzing an algorithm, which is better computing time?
(a) O (100 Log N) (b) O (N)
(c) O (2N) (d) O (N log N)
(e) O (N2).
|
40.
|
To
implement the Round Robin algorithm, which of the following data structure is
used?
(a) Stack
(b) Linear Queue
(c) Circular Queue (d) Priority Queue
(e) Double Stack.
|
Answers
31.
|
Answer : (d)
|
32.
|
Answer : (c)
Reason : According to the priority of the operators (
as first inner round brackets, then the inner square brackets and hence so
on.
|
33.
|
Answer : (a)
Reason : According to the time analysis of the
algorithm
|
34.
|
Answer : (d)
Reason : According to the pointer manipulations of the
variables
|
35.
|
Answer : (b)
Reason : According to the limit rule for the omega
notation ( Using the duality rule )
|
36.
|
Answer : (e)
Reason : This is the one of the conditions to define
the circular queue is full. All other are invalid choices.
|
37.
|
Answer : (d)
Reason : According to the limit rule for the big Oh
notation and the theta notation
|
38.
|
Answer : (d)
Reason : As the are only three nodes, and the list is
pointed by head.
|
39.
|
Answer : (a)
Reason : As this is a very small value when compared
with all the other values.
|
40.
|
Answer : (c)
Reason : According to the concepts of OS at process
scheduling, circular queue is the best suitable one when compared with all
the remaining one.
|
No comments :
Post a Comment