Question Paper Code: (10×2 20 Marks)
Question Paper Code: (10×2 20 Marks)
Question Paper Code: (10×2 20 Marks)
(Regulations 2017)
2. Design an algorithm to test whether the three numbers represent the sides of a
right angle triangle.
12. a) What is Binary Tree ? Explain Representation of Binary tree. Also explain
different operation that can be performed on Binary tree.
(or)
b) Write a necessary algorithm to insert a node into heap with suitable example.
(or)
b) Explain the Kruskal’s algorithm to solve minimum cost spanning tree problem.
b) Write a note on :
i) Polynomial-Time verification. (6)
ii) NP-Completeness Proofs. (7)
*85401* -3- X 85401
16. a) i) Construct a tree for the given inorder and postorder traversals.
Inorder : DGBAHEICF
Postorder : gdbhiefca (5)
ii) Provide greedy algorithm and find an optimal solution for the following
fractional Knapsack instance : Number of items (n)=7, maximum capacity
of knapsack (m)=20, Profits(p1,p2,p3,p4,p5,p6,p7)=(1,2,3,4,9,4,8,10) and
weights (w1,w2,w3,w4,w5,w6,w7) = (3,4,2,3,2,5,6). (10)
(or)
b) i) Using forward approach, solve the following multistage graph problem to
find the shortest path between S and T. (10)
ii) Design a polynomial time algorithm for a 2 coloring problem. (5)
___________________