Computer Algorithms
Computer Algorithms
P.T.O.
SB - 86
d) The inorder and preorder traversal of a binary tree are d b e a f c g and a
b d e c f g, respectively. The postorder traversal of the binary tree is:
i) debfgca ii) edbgfca
iii) edbfg ca iv) d e f g b c a
e) Let S be an NP-complete problem and Q and R be two other problems
not known to be in NP. Q is polynomial time reducible to S and S is
polynomial-time reducible to R. Which one of the following statements
is true?
i) R is NP-complete ii) R is NP-hard
iii) Q is NP-complete iv) Q is NP-hard
f) Which is not a constraints enforced on PRAM model
i) EREW ii) ERCW
iii) CRCW iv) None
g) Which of the following algorithms can be used to most efficiently
determine the presence of a cycle in a given graph?
i) Depth Frist Search
ii) Breadth First Search
iii) Prim’s Minimum Spanning Tree Algorithm
iv) Kruskal’ Minimum Spanning Tree Algorithm
-2-
SB - 86
Q3) Solve any 2 of the following (7 Marks Each) [14]
a) Solve job sequencing problem with deadlines using greedy approach for
following instance n=7. (p1,p2,....,p7) = (50, 15, 18, 16, 8, 25, 60)
(d1,d2,...,d7) = (1, 3, 4, 3, 2, 1, 2)
b) What is Difference between priori and posteriori analysis
c) Explain dynamic programming solution to 0/1 knapsack problem
ooo
-3-