Question 61
Question 62
o Delection of the smallest element o Insertion of an element if it is not already present in the setWhich of the following data structures can be used for this purpose?
Question 63
Question 64
Question 65
A single-source shortest path algorithm is executed on the weighted graph (V, E, w) with an arbitrary vertex ν1 of V1 as the source. Which of the following can always be inferred from the path costs computed?
Question 66
Consider the following dynamic programming code snippet for solving the 0/1 Knapsack problem:
def knapsack(values, weights, capacity, n):
if n == 0 or capacity == 0:
return 0
if weights[n-1] > capacity:
return knapsack(values, weights, capacity, n-1)
else:
return max(values[n-1] + knapsack(values, weights, capacity-weights[n-1], n-1),
knapsack(values, weights, capacity, n-1))
Given the values [60, 100, 120] and weights [10, 20, 30], what would be the output of calling knapsack(values, weights, 50, 3)?
Question 67
Question 68
Consider the following algorithm.
for i = 1 to n for j = 1 to n for k = 1 to n A [j , k] = max (A[j, k] (A[j, i] + A [i, k]);Which of the following statements is necessarily true for all j and k after terminal of the above algorithm ?
Question 69
Question 70
The following resolution rule is used in logic programming.
Derive clause (P ∨ Q) from clauses (P ∨ R), (Q ∨ ¬R)
Which of the following statements related to this rule is FALSE?
There are 89 questions to complete.