Top Banner
Model Question Paper Subject Code: MC0080 Subject Name: Analysis and Design of Algorithms Credits: 4 Marks: 140 Part A (One mark questions) 1. A process is a ……………. of activities actually being carried out executed, to solve a problem. A) Phase B) Progression C) Sequence D) Series 2. The symbol is used for …………………. A) Update B) Assignment C) Download D) Logical variables 3. n a a a a ........ 3 2 1 A) n i i a 1 B) i a C) i a D) i i a
22
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Model Qp MC0080 smu

Model Question Paper

Subject Code: MC0080

Subject Name: Analysis and Design of Algorithms

Credits: 4 Marks: 140

Part A (One mark questions)

1. A process is a ……………. of activities actually being carried out executed, to solve a

problem.

A) Phase

B) Progression

C) Sequence

D) Series

2. The symbol is used for ………………….

A) Update

B) Assignment

C) Download

D) Logical variables

3. naaaa ........321

A)

n

iia

1

B) ia

C) ia

D) i

ia

Page 2: Model Qp MC0080 smu

4. A function f: N N which is defined as 2)( xxf is

A) not a function

B) Assignment function

C) one-one function

D) Exponential function

5. A stack is an ordered list in which all insertions and deletions are made at one end, called the

…………………

A) bottom

B) top

C) medium

D) order

6. The insert operation on a stack is often called …………………

A) POP

B) PUSH

C) FLICK

D) LIFO

7. All leaves have the same depth, which is the tree’s ………………

A) Weight

B) Breadth

C) Height

D) Age

8. A ………………… is a collection of Binomial trees

A) Binomial forest

Page 3: Model Qp MC0080 smu

B) Binomial push

C) Binomial flick

D) Binomial heap

9. ……………. is a variant of a nim game and it is played with matches

A) Mariendab

B) Nimbad

C) Marienbad

D) Marinedab

10. A terminal node from which there is no legal move is a ……………. positon.

A) stable

B) losing

C) gaining

D) unstable

11. ……………….. is conceptually a top down approach for solving problems

A) Divide

B) Backtracking

C) Dynamic programming

D) Divide and Conquer

12. ………………… is a bottom up approach for solving problem

A) Backtracking

B) Divide and Conquer

C) Dynamic programming

D) Knapsack

Page 4: Model Qp MC0080 smu

13. Algorithms based on Greedy technique are used for solving ……………………………

A) Linear problems

B) Optimization problems

C) Quadratic problems

D) Bi-Quadratic problems

14. A minimum spanning tree of a weighted connected graph is its ……….. with the smallest

weight

A) Ordered tree

B) Spanning tree

C) Forest

D) Rooted tree

15. Every member of any language is said to be a ………………

A) non-string

B) alphabet

C) string

D) non-alphabet

16. For any set S of strings (S) =

A) S2

B) S0

C) S

D) S

17. If L is a language over an alphabet A, then a grammar for L consists of a set of grammar

rules of the form

A) yx

Page 5: Model Qp MC0080 smu

B) xx

C) xy

D) yy

18. If S is a start symbol for a grammar, then there must be atleast one production of the form

A) yy

B) Sy

C) SS

D) yS

19. ……………… model is the corresponding grammatical model that matches turing machines

in computational power.

A) Phase model

B) Structure model

C) Phrase-structure model

D) Pushdown model

20. ……………….. is an abstract entity constituted of mathematical objects like sets and a

function.

A) Auto Machine

B) Turing Machine

C) Automata Machine

D) Finite Machine

21. ……………… may consist of various number of loops, nested or in sequence.

A) Decidable problem

B) Algorithms

C) Phrase-structure problem

Page 6: Model Qp MC0080 smu

D) Pushdown problem

22.Halting problem is …………………..

A) decidable

B) infinite

C) Undecidable

D) a Finite Machine

23. The size of a problem is measured in terms of the …………………

A) output

B) input

C) level of problems

D) complexity

24. A problem is ………………… if it is NP and for which no polynomial time deterministic TM

solution is known so far.

A) NP hard

B) Finite

C) Solvable

D) NP complete

25. While proving a theorem, if an unrequired lemma is proved, we may ignore it. The only loss

is the loss of efforts in proving the lemma. Such a problem is called ………………

A) Step problem

B) Ignorable problem

C) Ignorable step problem

D) Deciding problem

Page 7: Model Qp MC0080 smu

26. …………… is a method of expressing algorithms by a collection of geometric shapes with

imbedded descriptions of algorithmic steps.

A) Flow chart

B) Chart

C) Numerical method

D) Differential method

27. The key at reach node is greater than or equal to the key at its ……………

A) Forest

B) Ancestors

C) Children

D) Root

28. If n is ……………. we set both the minimum and maximum to the value of the first element,

and then we process the rest of the elements in pairs.

A) Even B) Odd C) Multiple of two D) Multiple of three

29. In a …………………….. the previous pointer of the head of the list points to the tail, and the

next pointer of the tail of the list points to the head.

A) Linked list

B) Doubled list

C) Circular list

D) Sorted list

30. The procedure ………………….. finds the first element with key k in list L by a simple linear

search, returning a pointer to this element.

A) LIST-SEARCH (L, k)

Page 8: Model Qp MC0080 smu

B) LIST-COUNT (L, k)

C) LIST-SEARCH (L, k)

D) LIST-INSERT (L, k)

31. When two keys HASH to the same slot, we call the situation as ……………

A) Hashing

B) Collision

C) Slotting

D) Inserting

32. The keys in a binary search tree are always stored in such a way so as to satisfy the

…………………

A) Binary-search-tree property

B) Search-tree property

C) Binary-tree property

D) Binary-property

33. Basic operations on a binary search tree takes time …………. (to) the height of the tree.

A) Inversely proportional

B) Equal

C) Proportional

D) Three times more

34. A ……………….. is a binary search tree with one extra bit of storage per node: its color,

which can be either RED or BLACK.

A) Red tree

B) Black tree

C) Tree

Page 9: Model Qp MC0080 smu

D) Red-black tree

35. A red black tree with n internal nodes has height of at most …………………

A) lg (n + 1)

B) n log (n + 1)

C) 2 lg (n + 1)

D) lg (n + 1)2

36. A …………………. is simply red black tree with additional information stored in each node.

A) Order-statistic tree T

B) Order tree T

C) Statistic tree T

D) Derived tree T

37. ……………….. algorithm searches a given value or element in an already sorted array by

repeatedly dividing the search interval into half.

A) Binary

B) Binary search

C) Sorting

D) Merge

38. …………….. is a sorting algorithm which is based on the divide and conquer technique.

A) Mergesort

B) Integer

C) Greedy

D) Recursive

Page 10: Model Qp MC0080 smu

39. E[T(n)] =

A) E[X]

B) n – E[X]

C) n + E[X]

D) n[X]

40. Current best upper bound for multiplying matrices is approximately ………………

A) 376.22nO

B) 376.23nO

C) 376.2nO

D) nO

Part B (Two mark questions)

41. State true(T) or false(F)

The notation for the control mechanism for direct sequencing is obtained by writing of the

instructions,

i. Together on successive lines, or even on the same line if there is enough space on a line.

ii. Separated by some statement separator, say semi-colons, and in the order of intended

execution.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

42. State true(T) or false(F)

(i) A procedure, which can call itself, is said to be recursive procedure/algorithm.

(ii) The problem which has atleast one algorithmic solution, is called a computable problem.

A) (i) T (ii) T

B) (i) F (ii) F

Page 11: Model Qp MC0080 smu

C) (i) T (ii) F

D) (i) F (ii) T

43. State true(T) or false(F)

i. Exp(1.5, 3) = 3.375

ii. For any constants b and c with b > 1, n

c

n b

nlim 0

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

44. State true(T) or false(F)

(i) cbbc aaa logloglog

(ii) a

bb

alog

1log

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

45. State true(T) or false(F)

i. The FIFO property of a queue causes it to operate like a line of people in the registrars office.

ii.The queue has only a head.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

Page 12: Model Qp MC0080 smu

46. State true(T) or false(F)

(i) A linked list is a data structure in which the objects are arranged in a quadratic order

(ii) If the list is sorted the elements can appear in any order.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

47. State true(T) or false(F)

i. The number of disk accesses required for most operations on a B-tree is inversely

proportional to the height of the B-tree

ii. A binomial tree Bk is an ordered tree defined recursively.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

48. State true(T) or false(F)

(i) For a binomial tree Bk there are 2k nodes.

(ii) The only node with greater degree in Bk than in Bk–1 is the root.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

49. State true(T) or false (F)

i. Traversing a tree means exploring all the nodes in the tree starting with the root and exploring

the nodes in some order.

Page 13: Model Qp MC0080 smu

ii. In a postorder traversal, we first visit the left subtree, then all the nodes in the right subtree

and the root is not traversed.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

50. State true(T) or false(F)

(i) Preconditioning is also useful when only a few instances of a problem need to be solved.

(ii) In depth-first search algorithm we timestamp each vertex.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

51. State true(T) or false (F)

i. The principle of optimality states that components of a globally optimum solution must

themselves be optimal.

ii. Matrix multiplication is a binary operation

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

52. State true(T) or false(F)

(i) If one arrangement is optimal for A1, A2, …….,An then it will be optimal for any pairings of

(A1, A2,…..,Ak) and (Ak+1 An)

(ii) Matrix multiplication is not associative

A) (i) T (ii) T

B) (i) F (ii) F

Page 14: Model Qp MC0080 smu

C) (i) T (ii) F

D) (i) F (ii) T

53. State true(T) or false (F)

i. The minimum spanning tree problem is the problem of finding a maximum spanning tree for a

given weighted connected graph

ii. A given connected graph with n vertices, must have exactly (n–1) edges.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

54. State true(T) or false(F)

(i) Output function depends upon the particular algorithm used for the purpose.

(ii) The Algorithm due to Kruskal builds up a minimum spanning tree by adding edges to form

a sequence of expanding subtrees.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

55. State true(T) or false (F)

i. If L is any language, then, L = L = L

ii. R(S+T) = RS + RT

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

Page 15: Model Qp MC0080 smu

56. State true(T) or false(F)

(i) A null string is represented by

(ii) Plus operation is called as positive closure

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

57. State true(T) or false (F)

i. A string made up of terminals and /or non-terminals is called a sentential form.

ii. A production is called recursive if its left side occurs on its right side.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

58. State true(T) or false(F)

(i) A grammar for a finite language must be recursive.

(ii) The language MN starts with the two productions SA/B

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

59. State true(T) or false (F)

A Turing machine is a sixtuple of the form (Q, , , , q0, h) where

i. Q is the finite set of states

ii. is the set of tape symbols

A) (i) T (ii) T

Page 16: Model Qp MC0080 smu

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

60. State true(T) or false(F)

In turing machines the control taking into consideration the symbol and its current state decides

for further course of action including

(i) The change of the symbol in the cell being scanned.

(ii) State is always fixed and there is no change in it.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

Part C (Four mark questions)

61. State true(T) or false (F)

i. To show that a problem A is undecidable, we reduce another problem that is known to be

undecidable to A.

ii. Having proved that the halting problem is undecidable, we use problem reduction to show that

other problems are decidable.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

62. State true(T) or false(F)

(i) Any functional property of programs is undecidable.

(ii) The language accepted by a Turing machine contains atleast two strings.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

Page 17: Model Qp MC0080 smu

D) (i) F (ii) T

63. State true(T) or false (F)

i. A Boolean expression is said to be satisfiable if atleast one truth assignment makes the

Boolean expression false.

ii. A polynomial time reduction is a polynomial-time algorithm which constructs the instances of

a problem P2 from the instances of some other problems P1.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

64. State true(T) or false(F)

(i) For a given graph G = (V, E), two vertices V1 and V2 are said to be adjacent if there is an

edge connecting the two vertices in the graph.

(ii) A subset V1 of the set of vertices V of a graph G is said to be independent, if no two distinct

vertices in V1 are adjacent.

A) (i) T (ii) T

B) (i) F (ii) F

C) (i) T (ii) F

D) (i) F (ii) T

65. The well known techniques that have been found useful in designing algorithms are

i) Divide and conquer

ii) Dynamic Programming

iii) The Greedy Approach

iv) Bracketing

v) Graph problems

A) i, ii, iii, iv

Page 18: Model Qp MC0080 smu

B) i, ii, iii, iv, v

C) i, ii, iii

D) ii, iii, iv, v

66. If f(n) = 1 + 2 + …………..+ n, n 1 then f(n) =

A) (n2)

B) (n)

C) (2n)

D) (n3)

67. Complete the following fill in the blanks

TREE-MINIMUM(x)

1. while left [x] ……………

2. ……… x left[x]

3. return x

A) do, NIL

B) IF, NIL

C) NIL, do

D) NIL, IF

68. The list of statements of the procedure “CONNECTED-COMPONENTS” is given below

for each vertex vV{G}

do ………………………..

for each edge (u, v) E[G]

do if FIND-SET(u) FIND-SET(v)

then …………………..

A) UNION(u, v), MAKE-SET(v)

B) UNION, MAKE-SET

Page 19: Model Qp MC0080 smu

C) MAKE-SET(v), UNION(u, v)

D) UNION(u, v), MAKE-SET(u, v).

69. State true(T) or false(F)

(i) Edge (u, v) is a tree edge if it is used to discover v for the first time.

(ii) A graph is cyclic if and only if any depth first search forest of graph G yields no back edges.

(iii) Breadth first search discovers all vertices adjacent to a given vertex after moving to the

vertices far ahead in the search graph.

(iv) Breadth first search belongs to a branch of search algorithms known as heuristic search

algorithms.

A) (i) F (ii) F (iii) F (iv) F

B) (i) T (ii) T (iii) F (iv) T

C) (i) T (ii) F (iii) T (iv) F

D) (i) T (ii) T (iii) F (iv) F

70. State true(T) or false(F)

(i) Once an algorithm is designed, it is important to know its computational complexity.

(ii) The principle of optimality is always true

(iii) 10

n

(iv) 0

n

n

A) (i) F (ii) F (iii) F (iv) F

B) (i) T (ii) T (iii) F (iv) T

C) (i) T (ii) F (iii) T (iv) F

D) (i) T (ii) T (iii) F (iv) F

71. State true(T) or false(F)

(i) Once an algorithm is designed, it is important to know its computational complexity.

Page 20: Model Qp MC0080 smu

(ii) The principle of optimality is always true

(iii) 10

n

(iv) 0

n

n

A) (i) F (ii) F (iii) F (iv) F

B) (i) T (ii) T (iii) F (iv) T

C) (i) T (ii) F (iii) T (iv) F

D) (i) T (ii) T (iii) F (iv) F

72. State true(T) or false(F)

(i) A weighted directed graph is a directed graph in which each arc has been assigned weight.

(ii) In a single source shortest path if a vertex is not connected to the source by an edge, then it

is considered to have distance from the source

(iii)The Complexity of Kruskals Algorithm is O(a loga)

(iv) The weights on edges are negative.

A) (i) F (ii) F (iii) F (iv) F

B) (i) T (ii) T (iii) F (iv) T

C) (i) T (ii) F (iii) T (iv) F

D) (i) T (ii) T (iii) T (iv) F

73. State true(T) or false(F)

A finite automata consists of the following

(i) A finite set of states

(ii) A finite set of alphabets

(iii) An initial state

(iv) A subproblem

A) (i) F (ii) F (iii) F (iv) F

B) (i) T (ii) T (iii) F (iv) T

C) (i) T (ii) F (iii) T (iv) F

Page 21: Model Qp MC0080 smu

D) (i) T (ii) T (iii) T (iv) F

74. State true(T) or false(F)

(i) The language M* starts with the production S AS/.

(ii) A grammar is said to be ambiguous if its language contains some string that has two

different parse trees.

(iii) If yxxAy as , then x is left context and y is right context.

(iv)A grammar that is not context free must contain a production whose right side is a string of

two or more symbols.

A) (i) F (ii) F (iii) F (iv) F

B) (i) T (ii) T (iii) F (iv) T

C) (i) T (ii) F (iii) T (iv) F

D) (i) T (ii) T (iii) T (iv) F

75. State true(T) or false(F)

(i) The total configuration at the start of the machine is called the initial configuration.

(ii) Halted configuration is a configuration whose state component is the halt state.

(iii) Summing up the machine is supposed to be in the final state.

(iv) In the case of legal moves for TM for SUM function, first move of the head should be to the

left only.

A) (i) F (ii) F (iii) F (iv) F

B) (i) T (ii) F (iii) T (iv) T

C) (i) T (ii) T (iii) F (iv) T

D) (i) T (ii) T (iii) T (iv) F

Page 22: Model Qp MC0080 smu

Part - A Part - B Part - C

Q. No. Ans. Key Q. No. Ans. Key Q. No. Ans. Key Q. No. Ans. Key

1 C 21 B 41 D 61 C

2 B 22 C 42 A 62 A

3 A 23 B 43 A 63 D

4 C 24 D 44 C 64 A

5 B 25 C 45 C 65 A

6 B 26 A 46 B 66 A

7 C 27 C 47 D 67 C

8 D 28 B 48 A 68 C

9 C 29 C 49 C 69 D

10 B 30 A 50 A 70 C

11 D 31 B 51 A 71 C

12 C 32 A 52 D 72 D

13 B 33 C 53 D 73 D

14 B 34 D 54 B 74 D

15 C 35 C 55 A 75 B

16 C 36 A 56 A

17 C 37 B 57 A

18 B 38 A 58 D

19 C 39 C 59 A

20 B 40 C 60 C