Daa 5 Marks Answers
Daa 5 Marks Answers
Daa 5 Marks Answers
1.It deals (involves) three steps at 1.It involves the sequence of four
each level of recursion: steps:
Divide the problem into a number
o Characterize the structure of
of subproblems.
Conquer the subproblems by optimal solutions.
solving them recursively.
o Recursively defines the values
Combine the solution to the
of optimal solutions.
subproblems into the solution for
original subproblems. o Compute the value of optimal
solutions in a Bottom-up
minimum.
o Construct an Optimal Solution
from computed information.
To obtain the minimum distance, it It crosses one node only one time.
traverses one node more than one
time.
A→B→D
↘
C
Possible topological sorts: A,B,C,D or A,C,B,
Cycle Introduction:
A→B→D
↘ ↑
C←
Impossible to find a topological sort due to the cycle A→B→D→A
34: Discuss in detail about the class P, NP, NP-hard and NP-complete
problems. Give example for each class.
= P Class
The P in the P class stands for Polynomial Time. It is the collection of
decision problems(problems with a “yes” or “no” answer) that can be
solved by a deterministic machine in polynomial time.
Examples