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

As a result of public unease about the quality of schools in the 1960s, conservatives pushed forward radical changes to address these issues. Which sentence fro
The rising magma that may result from this type of plate movement may produce HELP
Find the discriminant and the number of real roots for this equation. 4x2 + 12x + 9 = 0 A. -144; one real root B. -144; no real roots C. 0; one real root D. 0;
Help me, Please!!!!!!!
How did Westerners justify their right to rule over other people? A. They believed that Western culture was superior to others. B. They adopted traditions of
Write about an event in the story “The most dangerous game” from one of the characters point of view.
what is the meaning of Albedo​
What was the most significant result of the 1957 launch of Sputnik? F U.S. military troops were deployed to Korea. G The United States ended its involvement in
25 POINTS!!! What shape can be created by the given net? triangular prism square pyramid cube rectangular prism
10-4+9/3=9 true or false​