cchavez2808 cchavez2808
  • 22-08-2019
  • Computers and Technology
contestada

)In the ADT graph, the method getNumberOfEdges has efficiency

A. O(1)

B.O(n)

C.O(logn)

D.O(n2)

Respuesta :

ExieFansler ExieFansler
  • 03-09-2019

Answer:

B.O(n)

Explanation:

In ADT graph the efficiency of the method getNumberOfEdges is O(n) because to get the number of edges we have to traverse the whole graph or every vertex if there are n vertices so the time complexity of traversing the graph comes out to be O(n).

Hence we conclude that the answer to this question is O(n).

Answer Link

Otras preguntas

Which of the four graphs shown below have a domain of all real numbers? (Check all that apply) *
help me asap I will mark you as the best answer
The ratio of butterflies to bees in Juan's insect collection is 3 to 4. If there are 32 bees, how many butterflies would there be?
Describe the discoveries that led to the modeling of DNA.
Which element of the cartoon best supports the perspective that football is dangerous?
Many account holders are required to purchase the checks they use. true or false
5. How did the US become involved in the Korean conflict?
Which traits should the student put in section ll?
We can now say that Lacey has an ______________ for her position.
Six plus a number is at least two times the number minus one