retagged by
581 views

1 Answer

1 1 vote

Answer: B

Explanation: the for loop in the bellman ford algorithm gets executed for v-1 times. after making v-1 passes, the algorithm checks for a negative weight cycle and returns appropriate boolean value.

Answer:
Position:
Show:

Related questions

2 2 votes
1 answers 1 answer
1.3k
1.3k views
rsansiya111 asked Dec 8, 2021
1,335 views
Suppose we do merge sort with a three-way split: divide the array into 3 equal parts, sort each part and do a 3 way merge.What would the worst-case complexity of this ver...
0 0 votes
1 1 answer
2.2k
2.2k views
rsansiya111 asked Dec 8, 2021
2,151 views
Suppose we want to extend the union-find data structure to support the operation Reset(c), which takes as input the name of a component c and then breaks up c into single...
0 0 votes
3 3 answers
1.7k
1.7k views
rsansiya111 asked Dec 8, 2021
1,720 views
Suppose there are k sorted lists (decreasing order) with n/k elements in each list.What is the time complexity to merge them into one single sorted list.Hint: Maintain a ...
0 0 votes
1 1 answer
7.8k
7.8k views
rsansiya111 asked Dec 8, 2021
7,780 views
. You are given a set of n points on the number line. They are given in arbitrary order. The task is to find the points that are closest to each other.To solve the proble...