Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
a. greedy method
b. branch and bound C
c. dynamic programming
d. d. divide and conquer ans
a. greedy method
b. dynamic programming
a. greedy method
b. dynamic programming
a. 110
c. 60
b. 90
d. 50
Ans. B
Which is optimal value in the case of job sequence problem Item : 1 2 3 4 5..
Profit : 20 15 10 5 1
Deadline : 2 2 3 3 3
1,3,4
1,2,4
4,2,3
1,5,2
B
How many edge are there in MCST generated from graph with 'n' vertices
n-1
n/2 - 1
n-2
n/2
a
Which of the following algorithms solves the all-pair shortest path problem?
a. Floyd's alg
b. Prim's algo
c. Dijkstra's
d. Warshall's
Answer:F
Worst case is the worst case time complexity of Prim’s algorithm if adjacency matrix is used?
a) O(log V)
2
b) O(V )
2
c) O(E )
d) O(V log E)
B
Which of the following is false about Prim’s algorithm?
a) It is a greedy algorithm
b) It constructs MST by selecting edges in increasing order of their weights
c) It never accepts cycles in the MST
d) It can be implemented using the Fibonacci heap
B’
What is the time complexity of Kruskal’s algorithm?
a) O(log V)
b) O(E log V)
2
c) O(E )
d) O(V log E)
B
Which of the following is false about the Kruskal’s algorithm?
a) It is a greedy algorithm
b) It constructs MST by selecting edges in increasing order of their weights
c) It can accept cycles in the MST
d) It uses union-find data structure
C
What is the time complexity of Dijikstra’s algorithm?
a) O(N)
3
b) O(N )
2
c) O(N )
d) O(logN)
C
Dijkstra’s Algorithm cannot be applied on ______________
a) Directed and weighted graphs
b) Graphs having negative weight function
c) Unweighted graphs
d) Undirected and unweighted graphs
B
Bellmann ford algorithm provides solution for ____________ problems.
a) All pair shortest path
b) Sorting
c) Network flow
d) Single source shortest path
D
. Fractional knapsack problem is also known as __________
a) 0/1 knapsack problem
b) Continuous knapsack problem
c) Divisible knapsack problem
d) Non continuous knapsack problem
B
What is the objective of the knapsack problem?
a) To get maximum total value in the knapsack
b) To get minimum total value in the knapsack
c) To get maximum weight in the knapsack
d) To get minimum weight in the knapsack
Which of the following statement about 0/1 knapsack and fractional knapsack problem is
correct?
a) In 0/1 knapsack problem items are divisible and in fractional knapsack items are indivisible
b) Both are the same
c) 0/1 knapsack is solved using a greedy algorithm and fractional knapsack is solved using
dynamic programming
d) In 0/1 knapsack problem items are indivisible and in fractional knapsack items are divisible