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 a shuttle used for on a hand loom? please help
free brainliest only one person answer please for my friens
6(y-12) someone please help
The first step in the decision-making process is to a. define your wants and needs b. identify your choices c. make a decision d. gather information Please sele
Find the value of √14/6
SOLVE FOR f(-2) MATH HELP PLS
PLZZZZZZZZZ HEEELPPPPPPPPP MEEEEE
What does Nocturnal mean?
bir sınıf ta iki der 3 ders Türkçe 5 ders fen 2 ders sosyal olduğuna göre kaç ders vardır.​
Evaluate the expression when n=3