Vous êtes sur la page 1sur 33

QUESTION BANK

UNIT I Subjective Questions 1. Define an algorithm. Describe the characteristics of an algorithm. 2. 3. Describe the performance analysis in detail. Define Omega Notation. Explain the terms involved in it. Give an Example

4. Write an algorithm to fine largest of given n numbers. Derive its time complexity using big oh notation. 5. Write the non-recursive algorithm for finding the Fibonacci sequence and derive its time complexity. Assignment Questions 1. Performance Analysis Tutorial Questions 1. Asymptotic Notation Objective Questions 1. Which refers to finite set of instructions? a) . Algorithm b) Pseudo code c) Input d) output 2. Which one is not a characteristic of an algorithm? a) Input b) . Output c) . Effectiveness d) size 3. The amount of time is needed to complete to run an algorithm is a) Space Complexity b) . Time Complexity c) Performance Analysis d) None 4. Is the code readable leads to a) Correctness

b) Readability c) . Simplicity d) Optimality 5. Prior analysis means a) Performance b) . Performance analysis c) . Performance measurement d) None 6. Posterior testing means a) Performance b) Performance analysis c) Performance measurement d) None 7. Big Oh notation refers to a) F(n)<=K*G(n) b) . F(n)>=K*G(n) c) K1*G(n)<=F(n)<=K2*G(n) d) None 8. Omega notation refers to a) F(n)<=K*G(n) b) F(n)>=K*G(n) c) K1*G(n)<=F(n)<=K2*G(n) d) None 9. Theta notation refers to a) F(n)<=K*G(n) b) F(n)>=K*G(n) c) K1*G(n)<=F(n)<=K2*G(n) d) None 10. A Randomized algorithm also known as a) Probabilistic Algorithm

b) . Priori c) Posterior d) Amortized algorithm 11. Las Vegas algorithm is a type of which algorithm a) Probabilistic Algorithm b) Priori c) Posterior d) . Amortized algorithm 12. What is the time complexity of an algorithm for binary search a) Logn b) . logn base 2 c) n d) 1 13. What is the time complexity for selection sort a) N b) . n^2 c) n^3 d) n logn 14. What is the time complexity for Merge sort a) N b) n^2 c) n^3 d) n logn 15. Profiling is also known as a) Performance b) Performance analysis c) Performance measurement d) None 16. What refers to an execution process performed on the data sets that are selected based on sampling technique

a) Profiling b) Debugging c) Analysis d) Decoding 17. What is the formula for space complexity a) S(p)=c+Sp(I) b) S=c+s(I) c) S(p)=c+S(I) d) S(P)=c+Sp 18. What is the formula for time complexity a) T(p)=c+Tp(i) b) T=c+T(I) c) T(p)=c+T(I) d) T(p) = c +Tp 19. What is the time complexity of Addition of two m X n matrices a) 2n b) 2n+1 c) 2n+2m+1 d) 2mn+2n+1 20. What is the space complexity for the following algorithmAlgorithm abc(a,b,c) {Return a+b+c*b-c+a;} a) Sp(I)=0 b) Sp(I)=1 c) Sp(I)=3 d) None

UNIT II

Subjective Questions 1. Explain the properties of Strongly Connected Components. 2. Write a Pseudo code for finding the strongly connected components of directed graph. Also analyze its time complexity. 3. Write an algorithm of biconnected components and also analyze its time complexity.

4. Find a necessary and sufficient condition for the root of a depth first search for a connected graph to be an articulation point. Prove it. 5. Prove or disprove an undirected graph G = (V,E) is biconnected if and only if for each pair of distinct paths from U to V there are two distinct paths from U to V that have no vertex in common except U and V. Assignment Questions 1. Union and Find Algorithm Tutorial Questions 1 Spanning Trees Objective Questions 1). Disjoint set means a) Si U Sj=0 b) Si ^ Sj= 0 c) Si < Sj d) 4.Si > Sj 2). One of the representations of the set is a) Tree b) Array c) Linked list d) Stack 3). In array representation who is the parent of root node? a) -1 b) 1 c) 2 d) 6 4). which is the parent node of 9 in given

1. 3 2. 7 3. 5 4. 4

5). There is a path from one node to all other nodes in a graph is a) Disconnected graph b) Connected graph c) Cyclic graph d) None 6). How many spanning tree are possible for complete graph with 4 vertices? a) 12 b) 16 c) 10 d) 15 7. The number of articulation point of the following graph? 1 1. 2 2. 1 2 3.33 8 4 4. 4 5 8. let G be an undirected connected graph with distinct edge weight let emax be the edge with maximum weight and emin be the edge with minimum weight. Which of the following statement is false? a) Every minimum spanning tree of G must contain emin. b) If emax is in a minimum spanning tree, then it removal must be disconnected c) No minimum spanning tree contains emax. d) G has a unique minimum spanning tree. 9. A graph G is biconnected if and only if _ _ _ _ _ _ _ _ _ a) it contains no articulation points b) it contains no loops 6 7

c) it contains no cycle d) it contains no parallel edges 10. Which of the following algorithm tells given graph is connected are not? a) Depth first search b) Path search c) Binary search d) Connected component 11. The number of bi-connected components of the following graph?
1. 2 E 2. 3 3. 5 D 4.4
H

B C

M J

12. Which of the following statement is not true in case of Adjacency Matrix? a) For the undirected graph, the adjacency Matrix is symmetric b) 2. Due to Symmetric relation between two sets of vertices of undirected graph, lower and upper triangle is same c) Adjacency Matrix can also deal with parallel edges d) If it is directed graph or undirected graph, all diagonal elements are zero in the adjacency Matrix 13. Which of the following statement is not true in case of a graph a) A directed graph is also called as digraph b) In the undirected graph, there is no arrowhead or tail c) The number of nodes on the path is path length d) A cycle is a path in which initial and terminal vertex is the same 14. Which of the following statement is NOT TRUE in case of DFS? a) The search can begin from any vertex of the graph b) The order of visiting each vertex through DFS is not unique c) DFS can also be used for directed graphs d) DFS is suitable for unconnected graphs also

15. Which of the following statement is not true in case of a BFS a) The BFS starts by showing all vertices as unvisited as in the case of DFS b) BFS picks each vertex one by one and adds it to the rear of the queue c) BFS creates very wide and short trees d) In BFS, all the unvisited vertices are pushed on to the stack 16. Connected graph with out cycle is called a) Forest b) 2 spanning tree c) Connected component d) Sub graph 17. What is another name for adjacency Matrix? a) Boolean Matrix b) Digraph Matrix c) Tree Matrix d) Traversal Matrix 18. 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. a) O(n+e) b) O(ne) c) O(n-e) d) O(2n ) 19. 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 ) 20. 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(n) d) O(n2) 21. 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) 22. the union find algorithm is a) Always linear b) Linear for all practical purpose c) Only asymptotically becomes greater than linear d) None UNIT III Subjective Questions 1. Write and explain control abstraction algorithm of divide and conquer. 2. Write an algorithm a deletion of a pair from a binary search tree. Explain with an example. 3. 4. 5. Analyze the average case time complexity of quick sort. Suggest refinements to merge sort to make it in place. Explain the Strassens Matrix Multiplication.

Assignment Questions 1. Quick Sort Application Tutorial Questions 1 Merge Sort Objective Questions 1. The time complexity of comparison based sorting algorithms is a) O (n) b) O (nlogn) c) O (n^2) d) O (n^n)

2. quick sort is run on two inputs shown bellow to sort in ascending order (i). 1,2,3n (ii). N,n-1,n-22,1 Let C1,C2 be the number of comparisons made for the input (i) and (ii) respectively. Then a) C1<C2 b) C1>C2 c) C1=C2 d) We can not say anything for arbitrary n. 3. Which of the following statements are true? I. as the number of entries in a hash table increases, the number of collisions increase. II. Recursive programs are efficient. III. The worst case complexity for quick sort in O(n^2). IV. Binary search using a linear linked list is efficient. a) I and II b) II and IV c) I and IV d) I and III 4. What is the best case time complexity of binary search? a) O (n) b) O (1) c) O (log n) d) O (n log n) 5. What is the time complexity of conventional matrix multiplication? a) O(n2) b) O(n^3) c) O (n^n) d) O(n) 6. Which of the following sorting technique is best? a) Merge sort b) Quick sort c) Insertion sort d) Selection sort 7. How can we calculate the time complexity of recessive methods?

a) Substitution method b) Separation method c) Division method d) None 8. Which of the following is the complaint on merge sort? a) Less time complexity b) More space complexity c) Less space complexity d) More time complexity 9. Which of the following technique solved by divide and conquer method? a) Binary search b) Spanning tree c) Knapsack d) None 10. 2, 5, 7, 9, 19, 24, 32, 37 in this given list after how many comparisons you will get 2 by using binary search a) 2 b) 1 c) 3 d) 7 11. The time complexity of the strassens matrix multiplication a) O(n^3) b) O(n^2.58) c) O(n) d) O(n^n) 12. given list is in sorted list its passed through the quick sort then what is the time complexity? a) O(n) b) O(n^2) c) O(n log n) d) O(log n)

13. the minimum number of comparisons required to merge two sorted files A with 10 elements and B with 15 elements a) 10 b) 15 c) 5 d) 20 14. Which of the following is the recursive time complexity function for binary search? a) T(n)=2T(n/2)+n b) T(n)=T(n/2)+n c) T(n)=T(n/2)+c d) T(n)=2T(n/2)+cn 15. Merge sort uses a) Dynamic programming b) Greedy method c) Divide and conquer d) Backtracking 16. For merging two sorted list of sizes m and n into a sorted list of size m+n we require comparison of a) O(m) b) O(n) c) O(m+n) d) O(mn) 17. Which of the following is the recursive time complexity function for merge sort? a) T(n)=2T(n/2)+n b) T(n)=T(n/2)+n c) T(n)=T(n/2)+c d) T(n)=2T(n/2)+cn 18. Which of the following is the recursive time complexity function for strassens matrix? a) T(n)=8T(n/2)+cn^2 b) T(n)=7T(n/2)+cn^2 c) T(n)=T(n/2)+c

d) T(n)=2T(n/2)+cn 19. Which of the following searching technique is best? a) Linear search b) Sequential search c) Binary search d) None 20. Which of the following data structure technique implements the recursive functions? a) Queue b) Tree c) Stack d) Linked list UNIT IV Subjective Questions 1.Explain the term feasible solution. Optimal solution and objective function. 2.Write a control abstraction for greedy method. 3.Explain the 0/1 knapsack problem algorithm with the greedy method. Show that this strategy doesnt necessarily yield optimal solution. 4.What is a minimum spanning tree? What are its applications? 5.Write a greedy algorithm to generate shortest path. Assignment Questions 1. Single Source Shortest Path problem Tutorial Questions 1. Minimum Cost Spanning Trees Objective Questions 1. Prims algorithm to find the minimum spanning tree of a graph has a time complexity. a) O (n^2) b) O(n*a(n)) where a(n) is a constant for all practical purpose. c) O(n^3) d) None. 2. Kruskals algorithm to find the minimum spanning tree of a graph a) Is O(n^2) and shows no improvement over prims except making it more complex.

b) 2. Is O(n*a(n)) where a(n) is a constant for all practical purposes arising from t he use of the union find algorithm. c) Is O(n^3) always d) None 3. Dijkstras single source shortest path algorithm has a complexity of a) O(n^2) b) O(n^3) c) O(n log n) d) None 4. Single source shortest path problems can be implemented by greedy method using a) Red block tree b) Min heap c) AVL tree d) None 5. consider a knapsack instance for n=3, (w1,w2,w3)=(3,5,6) and (p1,p2,p3)=(1,4,5) and m=10. The optimal solution is a) (0, 4/5, 1) b) (1/3, 0, 1) c) (1, 1, 3/5) d) (1, 1, 1) 6. Job sequence with dead line problem is done by a) Greedy method b) Divide and conquer c) Dynamic programming d) Backtracking 7. Which of the following technique is implemented by using greedy method? a) Binary search b) Merge sort c) Minimum cost spanning tree d) Insertion sort

8. Let n=4, (p1, p2, p3, p4)= (100, 10, 15, 27) and (d1, d2, d3, d4)=(2, 1, 2,1) which of the following is an optimal solution. a) {1, 2} b) {2, 3} c) {1} d) (4, 1} 9. let G(V, E), V=(1, 2, 3, 4, 5, 6, 7, 8}, E={(1,3), (1,2), (1,5), (2,3), (2,4), (2,7), (2,5), (4,5), (4,7), (4,8), (5,8), (6,8), (6,7)} weights of each edges are {13, 11, 2, 15, 8, 6, 12, 14, 10, 17, 5, 7, 21}, what is the minimum cost of spanning tree? a) 52 b) 34 c) 44 d) 60 10. Single source shortest path technique is developed by a) Greedy method b) Backtracking c) Dynamic programming d) Divide and conquer 11. Which statement is not true in case of backtracking Method? a) 1. Many problems which deal with searching for a set of solutions can be solved using the backtracking method. b) 2. Backtracking is a variation of the basic dynamic programming idea. c) 3. Using backtracking method, we can solve problems in an efficient way, when compared to greedy method. d) 4. For a given solution space a unique tree organization is possible. 12. Which statement is not true in case of backtracking Method? a) 1. Implicit constraints describe the way in which the xi must relate to each other. b) 2. Backtracking can not be used for N queens problem c) 3. Often the problem to be solved using backtrack method, calls for finding vector that maximizes or minimizes or satisfies a criterion function. d) 4. Explicit constraints are rules that restrict each xi to take on values only from set. one a given

13. If the Array of Integers a[1..n] are sorted by using backtracking method, then the criterion function P is _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 14. In backtracking, _ _ _ _ _ _ _ _ _ _ _ are the rules that restrict each xi to take on values only from a given set. a) Explicit constraints b) Implicit constraints c) Solution space d) Criterion functions 15. In backtracking, _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ are the rules that determine which of the tuples in the solution space of I satisfy the criterion function. a) Explicit constraints b) Implicit constraints c) Bounding function d) Permutation tree 16. The name backtrack was first coined by _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ a) D.H.Lehmer b) J.D.Ullman c) K.Thompson d) R.E.Bellman 17. In many applications of the backtrack method, the desired solution is expressible as _ _ _ _ _ ______ a) an n-tuple(x1, x2......xn) b) a algebric equation c) a matrix d) a set of binary trees 18. In backtracking Method, modified criterion function is also known as _ _ _ _ _ a) bounding function b) solution space c) Explicit constraints d) implicit constraints 19. In backtracking, the function which needs to be maximized or minimized for a given problem is known as _ _ _ _ _ _ _ _ _ _ _ _ _ _

a) Criterion function b) Maxmin function c) Backtracking function d) Leveling function 20. If we represent solution space in the form of a tree, then the tree is referred as _ _ _ a) BFS tree b) DFS tree c) state space tree d) Min - cost spanning tree UNIT V Subjective Questions 1.Explain the general Dynamic Programming problem. 2.Find the minimum number of operations required for the following chain matrix multiplication using dynamic programming. 3.A(30,40) X B(40,5) X C(5,15) X D(15, 4.Write a pseudo code for a linear time algorithm that generates the optimal binary search tree from the root table. 5.Write an algorithm of all pairs shortest path problem. 6. What is travelling sales person problem and what are its applications? Assignment Questions 1.Travelling Sales Person Problem Tutorial Questions 1. Optimal Binary search Trees Objective Questions 1. _ _ _ _ _ _ _ _ no of leaf nodes are available in tree organization of the 4-Queens solution space. a) 4 b) 8 c) 16 d) 24 2. If two queens are placed at position (i, j) and (k,l). Then they are on the same diagonal if and only if _ _ _ _ _ a) i +j = k + l

b) i%j=k+l c) I % j = k % l d) i/j = k/l 3. In backtracking, the tree organization for the solution space is also known as _ _ _ _ _ _ _ _ _ _ a) Binary tree b) AVL tree c) Permutation tree d) Balanced tree 4. The solution space tree of 8 queens contain _ _ _ _ _ _ _ _ _ _ _ a) 8 tuples b) 8* 8 tuples c) tuples d) 8 to the power of 8 tuples 5. In 8 Queens Problem, after applying the conditions, the size of solution space is _ _ _ _ _ _ _ a) 8 tuples b) Factorial 8 tuples c) 16 tuples d) 32 tuples 6. Each node in the tree organization defines _ _ _ _ _ _ _ _ _ _ _ _ _ _ a) Solution space b) Criterion function c) Problem state d) Explicit condition 7. A node which has been generated and all of whose children have not yet been generated is _ _ ________ a) Live node b) Dead node c) E-node d) X-node

8. The live node whose children are currently being generated is called _ _ _ _ _ a) Live node b) Dead node c) E-node d) X-node 9. What is the problem statement of N Queens problem? a) N Queens are to be placed on a 8 X 8 chess board b) N Queens are to be placed on a large chess board c) N Queens are to be placed on a N X N chess board d) N Queens are to be placed on a N X N chess board so that no two queens are on the same row, column or diagonal. 10. For N Queens problem, the time complexity is _ _ _ _ _ _ _ _ _ a) O (n) b) O (n^n) c) O (n^2) d) O (log n) 11. In sum of subsets problem, if n weights are considered then the solution space consists of _ _ ___________ a) 2 to the power of n distinct tuples b) n*n tuples c) tuples d) n tuples 12. 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. a) (1, 1, 0, 1) and (0, 0, 1, 1) b) (0, 1, 1, 0) and (1, 0, 0, 1) c) (1, 1, 1, 1) and (0, 0, 0, 1) d) (1, 0, 0, 0) and (1, 0, 1, 0) 13. In sum of subsets problem, the implicit constraint is _ _ _ _ _ _ _ _ _ _ a) The sum of the corresponding weights must be m

b) The product of the corresponding weights must be m c) The difference between any two weights must be m d) The square root of the sum of the corresponding weights must be m 14. 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 15. In the tree of fixed tuple size formulation, edges from level i nodes to level i + 1 nodes are labled with _ _ _ _ _ _ _ _ _ _ a) The value of xi, which is either zero or one b) The value of i^*xi c) The value of (i+1)^*xi d) The value of 2^*xi 16. From the given n distinct positive numbers, finding all combinations of these numbers whose sums are m is called _ _ _ _ _ _ _ _ _ _ a) Chromatic number problem b) N queens problem c) Sum of subsets problem d) mn combination problem 17. In the tree of variable tuple size formulation, the solution space is defined by _ _ _ _ a) All paths from the root node to any node in the tree b) All paths from the root node to the leaf node c) All paths from one leaf node to another leaf node d) All paths in the left sub tree 18. In the tree of variable tuple size formulation, the nodes are numbered as in _ _ _ _ _ _ _ _ _ _ __ a) Random order b) BFS c) DFS

d) FIFO order 19. In the tree of fixed tuple size formulation, all paths from the root to a leaf node define _ _ _ _ __________ a) Solution space b) Problem state c) Degree of bounding function d) Critical path 20. 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 UNIT VI Subjective Questions 1. Write the control abstraction of backtracking. 2. Draw and explain the portion of the tree for 4 queens problem that is generated during backtracking. 3. 4. 5. Write an algorithm of finding all m-colorings of a graph. Describe problem state, solution state and answer state with an example. Compare and contrast Fixed vs Variable tuple size formulation.

Assignment Questions 1. N- Queens problem Tutorial Questions 1.Sum of Subset Problem Objective Questions 1. If a graph is represented by its adjacency matrix nX n, and colors by the integers 1,2,3,..m, then the degree of the state space tree is _ _ _ _ _ _ _ _ a) n b) m c) mn d) m/n

2. If a graph is represented by its adjacency Matrix n X n and colors by the integers 1,2,.m, then the height of the state space tree is _ _ _ _ _ _ _ _ _ _ _ _ a) m b) n c) n + 1 d) m + 1 3. A graph with one or more edges, without a self-loop is atleast _ _ _ _ _ a) 1-chromatic b) 2-chromatic c) 3-chromatic d) 4-chromatic 4. If d is the degree of the given graph, then it can be colored with _ _ _ colors a) d +1 b) d -1 c) 2*d d) d 5. What is the time complexity of graph coloring problem ? a) O (mn) b) O (m + n) c) O (m - n ) d) O (n* m to the power of n) 6. A graph that can not be drawn on a plane without cross over between its edges is called _ _ _ _ _______ a) Planar b) Non planar c) Spanning tree d) Euler graph 7. Painting all the vertices of a graph with colors such that no two adjacent vertices have the same color is called _ _ _ _ _ _ _ _ _ _ _ of the graph. a) N- chromatic b) bi-chromatic

c) Coloring d) Hi-color 8. To check whether the nodes of G can be colored in such a way that no two adjacent nodes have the same color yet only m colors are used. This is termed as _ _ _ _ _ _ a) Coloring problem b) m-coloring problem c) m-color ability decision problem d) Planar color problem 9. How many colors (minimum) are needed for the graph in Figure (a)? a) 5 b) 4 c) 3 d) 2 10. What is the chromatic number of the graph in Figure (a)? Figure (a) a) 1 b) 2 c) 3 d) 5 11. The total number of different Hamiltonian cycles in a complete graph of n vertices is _ _ _ _ ___________ 12. A sufficient condition for a simple graph G with n vertices have a Hamiltonian cycle is that the degree of every vertex in G is atleast _ _ _ _ _ _ _ _ _ _ _ _ _ a) n b) n/2 c) n/3 d) n/4 13. Which statement is not true in case of Hamiltonian cycle? a) A Hamiltonian cycle is a round-trip path along n edges of G that visits every vertex once and returns to its starting position. b) A graph may contain more than one Hamiltonian cycle. c) A Hamiltonian cycle in a graph of n vertices consists of exactly n edges

d) Every connected graph has at least one Hamiltonian cycle 14. The traveling salesperson problem which asked for a tour that has minimum cost. Then this tour is a _ _ _ _ _ _ _ _ _ _ _ _ _ _ a) Hamiltonian cycle b) Cube connected cycle c) Principle of optimality d) Multistage graph problem 15. In the Figure (a), the removal of the following edge will not effect the Hamiltonian cycle Figure (a) a) (3,1) b) (1,7) c) (1,2) d) (4,5) 16. What is the directed Hamiltonian cycle in the graph of Figure (a)? Figure (a) a) 1,2,4,5,1 b) 1,2,3,4,5,1 c) 5,2,3,4,5 d) no directed Hamiltonian cycle 17. If the edge _ _ _ _ is deleted from the graph of Figure (a) , then it has no directed Hamiltonian cycle. a) (5,1) b) (5,2) c) (1,5) d) The removal of any edge has no effect on 18. What is the Hamiltonian cycle in the graph of Figure (a)? Figure(a) a) 1,2,3,6,7,1 b) 1,2,8,7 c) 1,2,7,8 d) None

UNIT VII Subjective Questions 1. Explain the general method of branch and bound. 2. 3. 4. 5. Explain the method of reduction to solve TSP problem using branch and bound. Write an algorithm to solve the Knapsack problem with the branch and bound. Explain the principles of FIFO branch and bound. Explain the principles of LIFO branch and bound.

Assignment Questions LC Branch and Bound Solution Tutorial Questions 1. FIFO Branch and Bound Solution Objective Questions 1. What do you mean, when you say a problem is in NP? a) A solution can be verified in Polynomial time. b) A solution can not be verified in Polynomial time c) A solution can be verified in logarithmic time d) A solution can not be verified in logarithmic time 2. In the Least Count (LC) search, which one is the ranking function? a) The child is right or left b) The child is problem node or not c) The child is answer node or not d) The child is dead node or not 3. An LC search coupled with bounding functions is called as _ _ _ _ _ _ a) LC branch-and- bound search b) bound-and-branch search c) Least count search d) State space search 4. In LC search, every time the child is checked by the condition that _ _ _ _ a) The child is right or left b) The child is problem node or not c) The child is answer node or not d) The child is dead node or not

5. Which is not true in case of LC search? a) It uses the cost function b) Among all the live nodes, we select a node which has minimum cost c) LC search algorithm gives answer node d) LC search algorithm gives the answer node, but it may not give the optimal answer node. 6. In branch and bound Method, the three common search strategies are _ _ _ _ a) FIFO, LIFO and LC b) Queue, stack and tree c) Array, linked list and stack d) Stack, queue and graph 7. The solution space can be organized into a tree by means of either of the two formulations. They are _ _ _ _ _ _ _ _ _ _ _ _ _ and _ _ _ _ _ _ _ _ _ _ _ _ a) Variable tuple size, fixed tuple size b) Heavy tuple size, light tuple size c) Red tuple size, green tuple size d) High tuple size, low tuple size 8. _ _ _ _ _ _ _ _ is the time complexity for the traveling salesperson problem, if it is solved by using LCBB. a) O(n ) b) O( 2n) c) O(n3 ) d) O(n2 2n) 9. In branch-and- bound terminology, a BFS like state space search will be called _ _ _ _ _ _ _ _ _ search. a) Linear b) Random c) FIFO 10. The LC branch and bound search of a tree will begin with upper=---------a) 1 b) 2 c) 3

d) 4 11. The FIFO search coupled with bounding functions is called as _ _ _ _ _ _ _ a) FIFOBB b) Least count search c) Cumulative reduction function d) Column reduction 12. The algorithm of FIFO branch and bound can begin with upper bound = _ _ _ _ a) 0 b) 1 c) 8 d) 2 13. In FIFO branch and bound, if cost function of the node is greater than upper, then _ _ _ _ _ a) The node gets killed b) The node becomes E-node c) That node is the minimum cost answer node d) That node is the problem node 14. In FIFOBB, square nodes indicate _ _ _ _ _ _ _ _ _ _ _ a) Answer nodes b) E-nodes c) Dead nodes d) Feasible nodes 15. In FIFOBB, initially, the queue of live nodes is _ _ _ _ _ _ _ _ _ _ _ _ a) Empty b) Full c) Half filled d) Alternatively filled 16. How do we reduce P to Q? a) Transform instances of P to instances of Q in polynomial time so that the solutions to Q provides the solutions to P b) The solutions to Q is the solutions to P

c) Complement the variables d) Inverse the variables 17. What does it mean if Q is NP-Hard ? a) Every problem P NP lep Q b) Every problem NP P gep Q c) Every problem P NP geP Q d) Every problem NP P leP Q 18. What does it mean if Q is NP-Complete? a) Q is NP- Hard and Q NP b) Q is nearly NP-Hard c) Q is Nondeterministic Turing Machine d) Q is Deterministic Turing Machine 19. What is the relation between P and NP? a) P? NP, but no one knows whether P= NP b) P = NP c) P > NP d) P < NP 20. A problem is intractable if all algorithms to solve that problem are of at least _ _ _ _ _ _ a) Logaritmemic time complexity b) Exponential time complexity c) Polynomial time complexity d) Linear time complexity UNIT VIII Subjective Questions 1. Differentiate between NP-Complete and NP-Hard. 2. 3. 4. 5. Write a Non Deterministic Knapsack algorithm. Explain the classes of P and NP What is meant by Halting problem explain with an example. State and explain Cooks theorem.

Assignment Questions 1. Cooks Theorem Tutorial Questions 1.Non Deterministic Algorithms Objective Questions 1. If is polynomial time reducible to , then we write it as _ _ _ _ _ _ _ _ _ _ _ _ a) Linear b) Polynomial c) Computability theory d) None 2. _ _ _ _ _ _ _ _ _ _ _ problems involve finding a grouping, ordering or assignment of a discrete, finite set of objects that satisfies given conditions a) Linear b) Non-Linear c) Combinational d) Hyper 3. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ is the branch of the theory of computation that Studies which problems are computationally solvable using different models of computation. a) Computability theory b) Finite automata c) Pushdown automation d) Turing Machine 4. The set of problems that cannot be solved i.e., No algorithm can be written for it. Such problems are known as _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ a) Undecidable problems b) Intractable problems c) Heavy hard problems d) Arbitrary problems 5. _ _ _ _ _ _ _ _ _ _ _ _ states that satisfiability is in P if and only if P=NP a) Cook`s theorem b) Max clique theorem c) Bin Packing Theorem d) Best Fit Theorem

6. Tractability means _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ a) Practically useful algorithm b) The algorithm can not be executed c) The algorithm is infinite in length d) The execution time of the algorithm is infinite 7. _ _ _ _ _ _ _ _ _ _ _ has a finite-state-control (its program), a two way infinite tape( its memory) and a read-write head(its program counter) a) CD-ROM b) CD Writer c) turning Machine d) parallel computer 8. If the time complexity of the algorithm is O () then _ _ _ _ _ _ _ _ _ _ a) It is not a natural problem b) It is practically useful algorithm c) It is a linear problem d) It is a non-linear problem 9. In traveling Salesperson problem, the salesperson needs to visit 1000 cities, then the complexity is _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ a) O (1000 !) b) O(10 ) c) O(100) d) O ( 50 ) 10. A Boolean circuit is a circuit of AND, OR and NOT Gates. We have to determine if there is an assignment of 0's and 1's to a circuits inputs so that the circuit output is The problem is called _ _ _ _ _ _ _ _ _ _ _ a) CIRCUIT- SAT Problem b) Boolean Problem c) KnapSack Problem d) High Circuit problem 11. _ _ _ _ _ _ _ _ _ _ _ _ problem can be phrased as given below "Given a description of a turning machine and its initial input, determine whether the program, when executed on this input, ever completes"

a) The halting problem b) Turning Machine problem c) Nonturning Machine problem d) Oracle Mahine problem 12. _ _ _ _ _ _ _ _ _ _ is the set of decision problems that can be solved by a deterministic machine in polynomial time a) The complexity class P b) The complexity class NP c) Co-NP class d) Game complexity 13. If E = ( ) and ( ) where ~ indicates NOT and are literals and E has two classes, then this problem is known as --a) 3-SAT Problem b) 4-SAT Problem c) 2K-SAT Problem d) 6-SAT Problem 14. _ _ _ _ _ _ _ _ _ _ process is one whose behaviour is non-deterministic i.e., the next state of the environment is not fully determined by the previous state of the environment. a) Stochastic b) Prefix tree c) Kraft`s inequality d) Genotype 15. Given N people, does there exist a group of size K such that every pair of people in the group knows each other? This is another example of _ _ _ _ _ _ _ _ _ problem a) Clique problem b) Knapsack problem c) Traveling Salesperson Problem d) Undecidable problem 16. All NP-Complete problems are _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ a) NP-Hard b) P-Hard

c) P d) NP 17. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 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 18. Given a set S of n nonnegative integers, _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ requires the division of S into two subsets such that the sums of number in each subset are as close as possible. a) Number Partitioning Problem b) Number Set Problem c) Number finding Problem d) Number elimination Problem 19. What is true in case of Clique problem? a) The clique problem is not in NP b) The clique problem is in NP c) The time complexity for clique problem in O(n) where n is the number of vertices d) clique problem is also known as vertex cover problem 20. What is K-Colouring problem ? a) Given a graph G with K edges, Can G be painted with K colors? b) Given a graph G with K vertices, Can G be painted with K colors? c) Given a graph G with K vertices, Can G be painted with K colors? d) Given a graph G with K loops, Can G be painted with K colors?

Vous aimerez peut-être aussi