Professional Documents
Culture Documents
NOTE: Each cycle test shall contain six questions and at most four of them
will be from the question bank and remaining questions will be asked from
the syllabus covered in the lectures taken before the corresponding cycle
test.
Cycle Test I (Question No. 1-20)
1|Page
a) Recursive algorithm for computing n!, where n is non-negative integer.
b) Recursive algorithm for computing the greatest common divisor of two
nonnegative integers a and b with a<b.
c) Recursive algorithm for binary search algorithm.
12. Write a short note on program correctness.
13. What is loop invariant? How is a loop
invariant used?
14. Define floor and ceiling functions with examples.
n(n + 1)(2n + 1)
∑ k2 using summation formula ∑ 1 k2 =
100 n
15. Find the value of .
50
6
16. Explain the various basic asymptotic
notations for measuring the complexity of an algorithm.
17. Explain the properties of the relations on a
set.
18. Determine whether the relation R on the set A is reflexive, symmetric, or
transitive, where set A = Z (set of integers); a R b if and only if a+b is
even.
19. Explain the following representations of the
relations:
a) Using Matrices
b) Using Digraphs
20. Explain Warshall’s algorithm.
2|Page
21. Draw the directed graph that represents the
relation {(a,a), (a,b), (b,c), (c,b), (c,d),(d,a),(d,b)}.
22. Find the matrix representing the relations S oR , Where the matrices
representing R and S are
1 0 1 0 1 0
M R = 1 1 0 and M S = 0 0 1 .
0 0 0 1 0 1
23. Find the matrix representing the relation R 3, where the matrix
representing R is
0 1 0
M R = 0 1 1
1 0 0
3|Page
31. Find the incidence matrix of the following
graph:
4|Page
38. Explain the pre-order traversal with proper
example.
39. Explain the in-order traversal with proper
example.
40. Explain the post-order traversal with proper
example.
Note:
1. Use A4 size paper only. Write your name, roll number, date of submission
on the front of the assignment file.
2. All work must be individual and in your handwriting.
3. Your must submit before the submission deadline. Late submissions will
not be awarded.
--------------------------------------------------------------------------------------------------------
5|Page
Deadline: 21-05-2011 Total
Marks: 5.0
6|Page