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

A rectangular garden is 6 feet long and 4 feet wide. A second rectangular garden has dimensions that are double the dimensions of the first garden. What is the
What is the average velocity of atoms in 1.00 mol argon at 275k? For m use 0.0399 kg
if f(x)= x- 6 and g(x) = x^2(x+3), find g(x) x f(x)
Circle 3 words that give you a clue about description
Which of the following statements about models is correct
A student draws the net below to show the dimensions of a container that is shaped like a right rectangular prism. A) 19 B) 30 C) 38 D) 62
A 100 W lightbulb is brighter than a 60 W lightbulb when both operate at the same voltage of 120 V. Part A If, instead, they were both operated at the same curr
Can I get some help with these math problems? Algebra 1B
who where buttermilk people​
you are the king of a Sumerian city-state. Write a letter to your priests asking them to make offerings to the gods in order to protect your farms from a possib