Академический Документы
Профессиональный Документы
Культура Документы
Question Bank
3.If for every pair of vertices, i, j there exists a path from i to j and a path from j to i then the
directed graph is .......:->strongly connected
4.An undirected graph is called ......if for every pair of vertices there exists a path between
them
.:->connected
True or False
3. Define Program.
1. In a binary tree, the number of terminal nodes (leaf nodes)are 10, then the
number of nodes with two children are
A) M,L,N,K,P,O,R
B)L,N,M,K,P,R,O
C)P,R,O,K,L,N,M
D)M,N,O,P,R,L,K
ANS:A
D)the level of any node is two more than the level of parent node
ANS:A
4. When comparing the binary tree with the general tree, which statement is true?
C)The general tree, like the binary tree consists of left and right child
D)Binary tree consists of left and right child, whereas a general tree consists of
collection of sub trees.
ANS:D
5. If T(n,e) represents the maximum time taken by DFS for an n-vertex, e-edge
graph, then what is the value of T(n,e) if adjacency lists are used.
6.If S(n,e) represents the maximum additional space taken by DFS for an n-vertex, e-
edge graph, then what is the value of S(n,e) if adjacency lists are used.
A)O(n) B)O(n+e) C)O(n-e) D)O(2n )
ANS:A
7.If T(n,e) represents the time complexity of DFS for an n-vertex, e-edge graph, then
what is the value of T(n,e) if adjacency matrix is used.
A)O(n+e)
B)O(ne)
C)O(1)
D)O(n2)
ANS:D
8.If adjacency matrix is used, then what is the time complexity of BFS algorithm?
A)O(n) B)O(e)
C)O(n2) D)O(n+e)
ANS:C
9.The broken edges of the depth first spanning tree of the graph are called _ _ _ _
ANS:C
B)dead node
C)Hi node
D)articulation point
ANS:D
A)Many problems which deal with searching for a set of solutions can be
solved using the backtracking method.
A)Implicit constraints describe the way in which the xi must relate to each
other.
B)Backtracking can not be used for N queens problem
C)Often the problem to be solved using backtrack method, calls for finding one
vector that maximizes or minimizes or satisfies a criterion function.
D)Explicit constraints are rules that restrict each xi to take on values only
from a given set.
ANS:B
C)a matrix
21.If we represent solution space in the form of a tree, then the tree is referred as_ _ _
22.In backtracking, the tree organization for the solution space is also known as __ _
_______
25.A node which has been generated and all of whose children have not yet
been generated is
26.The live node whose children are currently being generated is called _ _ _ _ _
29.In the sum of subsets problem, if n=4, (w1, w2 w3, w4) = (11, 13, 24, 7) and
m=31 then solutions are _ _ _ _ _ _ _ where 1 represents weight chosen 0 represents
weight is not choosen.
31.If n = 4 in the sum of subset problem, then the possible leafnodes in the tree
organization are _
A)4 B)8 C)20 D)16
ANS:D
32.From the given n distinct positive numbers, finding all combinations of these
numbers whose sums are m is called _ _ _ _ _ _ _ _ _ _
33.In the tree of fixed tuple size formulation, all paths from the root to a leaf node
define _ _ _ _ _ _ _ _ _ _ _ _ _ _
A)solution space
B)problem state
D)critical path
ANS:A
34.In the tree of fixed tuple size formulation, the nodes are numbered as in _ _ _
A)linear order
B)random order
C)D-search
D)BFS
ANS:C
35.Painting all the verticies of a graph with colors such that no two adjacent vertices
have the same color is called _ _ _ _ _ _ _ _ _ _ _ of the graph.
35. If elements are sorted then the following search is most suitable :-> binary search
36. The difference between merge sort and quick sort is :-> use of external array
37. According to pseudo code conventions elements of D array can be :-> s[4,5]
Algorithm pqr(a,b)
it
Algorithm pqr(a,b)
} :->ax b
39. In knapsack problem optimal solution is obtained by using the following method :-
>selecting
40. If j is a node on the path item then set parent (i) <— roof (i) this rule is called as :->
collision rule
True or False
1. The term _ _ _ _ _ _ _ _ _ _ _ _ refers to all state space search methods in which all
children of the E-node are generated before any other live node can become the E-node
A)Branch-and-bound
B)modular arithmetic
C)inter polation
D)transformation
ANS:A
2. A search strategy that uses a cost function to select the next E-node would always choose
for its next E-node a live node with least _ _ _ _ _ _ _ _ _ _
A)FIFO function
B)LIFO function
C)cost function
D)branch function
ANS:C
A)4
B)8
C)12
D)16
ANS:A
5. _ _ _ _ _ _ is the cumutative reduction sum of the cost matrix
A)D-search
B)F-search
C)L-search
D)I-search
ANS:A
8. We start at a particular node in the graph, visiting all nodes exactly once and come back
to initial node with minimum cost. This is known as _ _ _ _ _ _ _
10. In finding the reduced cost matrix from a given cost matrix , we take minimum
element from first column ,then subtract that element from first column and take
minimum element from second column , and then subtract that element from
second column and so on. This is known as _ _ _ _ _ _ _ _ _ _
ANS:A
ANS:C
12. If M=15, n=4, P1, P2, P3, P4=(10,10,12,18) and W1,W2, W3,W4=(2,4,6,9) of
0/1 knapsack problem then using LC branch-and-bound search, the upper
bound of node 1 is _ _ _ _ _
ANS:A
ANS:D
14. In Job sequencing with deadlines problem, for any Job i the profit Pi is earned if and only
if _ _ _ _ _ _ _ _
A)0
B)á
C)1
D)2
ANS:A
16. In branch and bound Method, the three common search strategies are __ _ _
A)O(n )
B)O( 2n)
C)O(n3 )
D)O(n2 2n)
ANS:D
18. In branch-and- bound terminology, a BFS like state space search will be called _ _ _
_ _ _ _ _ _ search.
19. The LC branch and bound search of a tree will begin with upper = _ _ _ _
1. If four matrices A,B,C and D are given with orders 50Xl 0, IOX40,40X30 and 30X5
respectively
2. then the minimum number of multiplications required :->10,500
3. If four matrices A,B,C and D are given with orders 50Xl 0, IOX40,40X30 and 30X5
respectively
4. then the maximum number of multiplications required :->87,500
5. The number of orderings of product of 5 matrices is :-> 14
6. If four matrices A,B,C and D are given with orders 5X 4 4X3 3x2 and 2x5 respectively
then the
7. minimum number of multiplications required to get product ABCD :->114
8. If four matrices A,B,C and D are given with orders 5X 4 4X3 3x2 and 2x5 respectively
then the
9. maximum number of multiplications required to get product ABCD :->190
10. If four matrices A,B,C and D are given with or 50x10 10x40 40x30 30x5
respectively
11. then the number of orderings of product of matrices :->5
True or False
1. Heap is defined to be a complete binary tree. T
2. In a Max heap the largest key is at the root. T
3. The asymptotic complexity in terms of n is O(log n)? T
4. Heap sort is found to be very efficient with regard to storage requirement. T
5. For the improvement of efficiency of quick sort the pivot can be the mean element.T
1. How do we reduce P to Q ?
B)P = NP
C)P > NP
D)P < NP
ANS:A
ANS:A
C)polynomial-time complexity
ANS:B
ANS:D
ANS:D
A)linear
B)non linear
C)deterministic
D)Nondeterministic
ANS:C
A)A clique is a subset of vertices fully connected to each other i.e., a complete
subgraph of G
A)To find out "How large is the maximum-size clique in a graph "
B)To find out "How many Nodes are there in the graph "
C)To find out "How many parallel edges are there in the graph "
D)To find out "How many loops are there in the graph "
ANS:A
A)as the input size n increases, we are unable to solve them in reasonable time
D)complex algorithm
ANS:A
20. In _ _ _ _ _ _ _ _ _ _ algorithms, operations are allowed to choose any one of the
outcomes subject to the termination condition.
A)bubble
B)hyper
C)deterministic
D)Nondeterministic
ANS:D
22. _ _ _ _ _ _ _ _ _ is the time complexity of the function choice(), success() & failure()
A)O (1)
B)O (n)
C)O (nlogn)
D)O(n2)
ANS:A
ANS:B
24. Any problem for which the answer is either zero or one is called _ _ _ _ _
B)minimization problem
C)maximization problem
D)optimization problem
ANS:A
25. Any problem that involves the identification of either minimum or maximum value of
a given cost function is known as _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ _ _
A)min problem B)max problem
A)linear problems
B)Non-linear problems
C)decision problems
D)hard problems
ANS:C
A)Linear B)Non-Linear
C)Combinational D)Hyper
ANS:C
A)CD-ROM
B)CD Writer
C)turning Machine
D)parallel computer
ANS:C
32. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ search will run the same steps every time if it is given the
same input.
A)Deterministic Search
B)Nondeterministic Search
C)TABU search
D)Huffman search
ANS:A
True or False
1. Explain how branch and bound technique is used to solve 0/1 knapsack
problem.
2. What are the differences between FIFO and LC branch and bound solutions?
3. Explain the principles of FIFO Branch- and-Bound.
4. Consider the travelling salesperson instance defined by the cost matrix.
5. Obtain the reduced cost matrix and the portion of the state space tree that will be
generated by LCBB.
6. How to search an answer node in branch and bound using Least Cost Search?
Explain.
7. Obtain reduced cost matrix for travelling sales person problem. Consider the
instance define by the cost matrix:
8. Write the branch and bound algorithm to generate minimum length tour for the
given cost adjacency matrix.