Beruflich Dokumente
Kultur Dokumente
Ans is A
The solution to atop level instance of
a problem is obtained by going down
and obtaining solutions to smaller
problems.
Ans is D
Sorting merge sort, quicksort
Multiplication - Karatsuba algorithm is
a fast multiplication algorithm,
Strassens multiplication
Syntactic analysis top down parsers
All the above algorithms are designed
using d&c approach
256
512
10
12
Ans is 10
i) Coz, at each iteration half the
number of input is ignored. So it takes
atmost 10 comparisons for the binary
search algorithm to find the value in
an array of size 1024
ii) Yet another way is to substitute the
input size in the time complexity
formulae of BS algorithm(i.e.,
log(1024)=10)
15,18,10,20
15,10,20,18
15,20,10,18
15,20,10,18
-----
10,18,15,20
15,10,18,20
10,15,20,18
15,10,20,18
-----
10,15,18,20
10,15,18,20
10,15,18,20
10,15,20,18
Ans is C
Ans is b
Ans is C
7. In this sequence, 11 4 20 45 32 60
98 70, which element seems to be the
pivot?
a)
b)
c)
d)
70
20
98
4
Ans is B
O(n^2.807)
O(n^2.3737)
O(n^3)
None of these
Ans is A
Greedy Method
In a greedy method we attempt to
construct an optimal solution in
stages.
Ans is C
c)
d)
e)
O(N+W), O(NW)
(NW), O(N+W)
O(N), O(NW)
O(NW), O(N)
O(N+W), O(N+W).
Answer : (b)
i) the memory table ( 2 D matrix )
contains N rows and W columns,
hence it is NW
ii) the composition of the optimal load
takes up to N+W time
pi xi is maximum
wi xi < c
Both
Only A
Ans is C
a)
b)
c)
d)
(1,6),(6,5),
(1,6),(6,5),
(1,6),(6,5),
(1,6),(6,5),
(5,4),
(5,7),
(5,7),
(5,4),
(4,3),
(7,2),
(7,4),
(4,7),
(3,2),
(2,3),
(4,3),
(7,2),
(2,
(3,
(3,
(2,
7)
4)
2)
3)
Ans is A
a) (1,6), (6,5),
b) (1,6), (6,5),
c) (1,6), (3,4),
d) (1,6), (6,5),
Ans is C
Ans is False
It always terminates, but may
produce incorrect results.
Ans is False
BellmanFord is used primarily for
graphs with negative edge weights
Answer : (a)
Reason: In the Kruskals algorithm,
for the construction of minimal
spanning tree for a graph, the
selected edges always form a forest.
Ans is D
Dynamic Programming
Dynamic programmingis a method for
solving complex problems by breaking them
down into simpler subproblems.
applicable to problems exhibiting the
properties of overlapping subproblems and
optimal substructure
overlapping subproblems means those
problems that can be broken down into subproblems and the solutions for which are reused several times eg., Fibonacci series
Ans is D
Ans is A
Ans is D
Warshall and Floyd algorithm is aka all
pair shortest path algorithm
Ans is C
OBST is an algorithm that is used for
the construction of a tree which has
minimum search cost for each key
node in the tree
Ans is C
Backtracking
Backtracking is a general algorithm
for finding all (or some) solutions to
some computational problem, that
incrementally builds candidates to the
solutions, and abandons each partial
candidate c ("backtracks") as soon as
it determines that c cannot possibly be
completed to a valid solution
Implicit constraint
Explicit constraint
both
none
Ans is B
Ans is A
leaf organization
node organization
tree organization
space organization
Ans is C
Ans is C
Ans is C
Ans is A
colorability decision
colorability optimization
both a and b
none
Ans is B
Ans is C
Ans is D
Ans is D
Ans is B
Ans is D
Ans is C