Quiz Space

Programming, Data Structures and Algorithms using Python · End Term · 13 Sept 2026 · May 2026 term

Question 13: Suppose we run the Bellman-Ford algorithm on a directed …

Question 13

+4 marksOne correct option

Suppose we run the Bellman-Ford algorithm on a directed graph where every edge weight is strictly positive. Which of the following statements accurately describes the behavior of the algorithm?

  1. A

    The algorithm will produce incorrect results because it is exclusively designed to process negative edge weights.

  2. B

    The algorithm will correctly find the shortest paths; however, its worst-case time complexity is higher than that of Dijkstra's algorithm for graphs with non-negative edge weights.

  3. C

    The algorithm will terminate early after exactly 1 iteration because positive edge graphs do not require path relaxation.

  4. D

    The algorithm will flag the graph as containing a negative cycle because it expects at least one negative edge value.

Show answer

Correct answer

  • B

    The algorithm will correctly find the shortest paths; however, its worst-case time complexity is higher than that of Dijkstra's algorithm for graphs with non-negative edge weights.

Question 13 of 25 in the IIT Madras BS Programming, Data Structures and Algorithms using Python (PDSA) End Term paper sat on 13 Sept 2026, in the May 2026 term (Programming, Data Structures And Algorithms Using Python 13 Sep 26). It carries 4 marks.

More questions from this paper

  1. Q1What does the function f(1000,2) return?
  2. Q2Consider the following implementation for Queue
  3. Q3What is the total weight of the Minimum Spanning Tree (MST) of this graph?
  4. Q4Figure question
  5. Q5Figure question
  6. Q6Figure question
  7. Q7Inscript Consider the following grid.
  8. Q8Figure question
  9. Q9Figure question
  10. Q10Figure question
  11. Q11Figure question
  12. Q12Figure question
  13. Q14Figure question
  14. Q15Figure question
  15. Q16Suppose the letters {A, B, C, D, E} occur with the following frequencies. How many bits will be used to encode the lett…
  16. Q17Figure question
  17. Q18Consider the following function:
  18. Q19Figure question
  19. Q20Which of the following statements provides the most accurate definition of the complexity class NP?
  20. Q21Which of the following statements is/are true about quicksort?
  21. Q22Let G be a simple, undirected graph with n = 10 vertices. If G is disconnected, which of the following could be the tot…
  22. Q23Which of the following edges cannot be present in the original graph? (Select all that apply)
  23. Q24Figure question
  24. Q25Figure question