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

what is 12.2billion divided by 3.8%
Can someone please answer this
At 10a.m. Juan leaves the city traveling north at 60 mi/hr. One hour later mel leaves the city traveling south at 50 mi/hr. At what time will they be 830 miles
why might someone want to flee to afghanistan to seek a home in a new country
White phosphorus, P4, is prepared by fusing calcium phosphate, Ca3(PO4)2, with carbon, C, and sand, SiO2, in an electric furnace.2Ca3(PO4)2(s) + 6SiO2(s) + 10C(
Can someone please answer this
True or false the origin would be included in the solution set for the following inequality: y>3x-9
why is it important to know your variables when conducting an investigatory problem  ?
4x-5y=20 find the slope
The time t required to drive a certain distance varies inversely with the speed r. If it takes 2 hours to drive the distance at 40 miles per hour, how long will