Ask Question
31 March, 07:25

In the ADT graph, the method addEdge has efficiency

A. O (1)

B. O (n)

C. O (logn)

D. O (n2)

+4
Answers (1)
  1. 31 March, 09:21
    0
    B. O (n).

    Explanation:

    In an ADT graph the method addEdge uses an Array of list. So in the worst case and the worst will be when the list already has n elements in it.

    So to add an edge we have to iterate over the list upto nth element and then add the edge after that. So it has to travel over n elements.

    So we can say that the answer is O (n).
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “In the ADT graph, the method addEdge has efficiency A. O (1) B. O (n) C. O (logn) D. O (n2) ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers