Daa Important Questions
Daa Important Questions
1.Write Floyd Warshal’s algorithm and find all pairs shortest paths for the following
graph.
2. Write the Greedy algorithm for Job sequencing with deadlines problem and solve,
Given n=5 jobs with profits (P1,P2,P3,P4,P5)=(1,5,20,15,10) and deadlines
(d1,d2,d3,d4,d5)=(1,2,4,1,3).
3.Write Kruskal’s algorithm and find the minimum cost spanning tree for the
following graph.
4.Solve the following 0/1 knapsack problem using LC branch and bounding
N=3 m=6 (P1P2P3)=(1,2,5) (W1W2W3)=(2,3,4)?
5.Solve the single source shortest path problem ? Explain its algorithm?
6.Write the Greedy algorithm for Knapsack problem and solve the following instance.
Given n=3 objects with profits (P1,P2,P3)=(25,24,15) and weights
(w1,w2,w3)=(18,15,10) and M=20
7.Explain about P, NP, NP-Hard, and NP-Complete classes with examples.
8.Solve the following following travelling sales person problem using Dynamic
programming ?
9.Write Prim’s algorithm and find the minimum cost spanning tree for the following
graph.
10. Write the Greedy algorithm for Job sequencing with deadlines problem and solve,
Given n=5 jobs with profits (P1,P2,P3,P4,P5)=(20,15,10,5,1) and deadlines
(d1d2,d3,d4,d5)=(2,2,1,3,3).
11. Draw the state space tree generated by LCBB for the 0/1 Knapsack instance n=4
objects, Profits (P1,P2,P3,P4)=(10,10,12,18) and Weights (W1,W2,W3,W4)=(2,4,6,9)
and M=15.
13.Write Dijkstra’s algorithm and find the single source shortest paths for the
following graph.
14.Write the Greedy algorithm for Knapsack problem and solve the following
instance. Given n=7 objects with profits (P1,P2,P3,P4,P5,P6,P7)=(10,5,15,7,6,18,3)
and weights (w1,w2,w3,w4,w5,w6,w7)=(2,3,5,7,1,4,1) and M=15
16.Solve the following OBST problem for n=4 and (a1 a2 a3 a4)=(do,if,int,while)
p(1:4)=(3,3,1,1)and q(1:5)=(2,3,1,1,1)?
6. Data structures that are used in Branch and Bound are _____ [ ]
A) either stack or queue B) neither stack nor queue C) linked list D) trees
3. In branch and bound method the three common search strategies are
____________ , __________________ and ____________.
5. The _____________ of a device is the probability that the device will function
properly
9.NP-complete,stands,for ____________________________________________
10.We start at a particular node in the graph, visiting all nodes exactly once and
come back to initial node with minimum cost is known as
______________________________ problem.