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

If y = 4x + 3 were changed to y = -4x + 3, how would the graph of the new function compare with the original?
What is 2.5% of an $80,000 household income
You should have your headlights on when you are driving during the daylight hours because it is easier:
Read the excerpt from Chapter 3 of Wheels of Change . Driven by a desire for comfort and physical well-being, several groups of women introduced alternative ap
how did the rise of huge industrial cartels affect free market competition?
the fraction 6/9 produces a repeating decimal 0.6 ? true or false
The Lewis dot structure for nitrogen shows the symbol, N, surrounded by a total of _____ dots.
Have you ever been counseled for cash handling situations?
A company with a labor agreement under which union membership cannot be required as a condition of employment is considered a
What remnants of primitive culture are left in greek mythology?