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 the answer to 785x891
What is the value of x to the nearest tenth? Question #4
What type of triangle is shown? equiangular triangle acute triangle right triangle obtuse triangle
Which process in light-dependent reactions results in the release of hydrogen ions, electrons, and oxygen?
i need some help please
What is the correct unit for electrical power
What television media can be an unlikely first influence toward violence? cartoons game shows commercials movies
the science that uses principles of physics to understandthe humane machine is called
Can someone please help me with how to do this question? I have an exam tomorrow, and It’s greatly appreciated :)) In a solution containing 15.6 g of MgCl2 in 1
Karl Marx’s writings inspired the revolutions in the Soviet Union, China, Vietnam and Cuba among others. What type of government did Marx believe is the best ty