emilyb7191 emilyb7191
  • 22-08-2019
  • Computers and Technology
contestada

In the ADT graph, the method addEdge has efficiency

A. O(1)

B.O(n)

C.O(logn)

D.O(n2)

Respuesta :

ExieFansler ExieFansler
  • 28-08-2019

Answer:

B.O(n).

Explanation:

In an ADT graph the method addEdge uses an Array of list.So in the worst case and the worst will be when the list already has n elements in it.

So to add an edge we have to iterate over the list upto nth element and then add the edge after that.So it has to travel over n elements.

So we can say that the answer is O(n).

Answer Link
Shirleythurmond57
Shirleythurmond57 Shirleythurmond57
  • 12-03-2021

Answer:

Thx 4 the points bro

Explanation:

its B

Answer Link

Otras preguntas

If -nx2 + tx + c = 0, what is x equal to?
What is the negative form of Elles y regardent la télé
find the value of x , if log₂ [log₅ (log₃x)] = 0
If -nx2 + tx + c = 0, what is x equal to?
What was vomitorium used for?
why is gold preferred as a superior metal over silver and bronze?
State a true conclusion. 1) If you accept the hypothesis, then you accept the conclusion. 2) You accept the conclusion. Conclusion: ?
Multiply and simplify.(a - 2b) (2a - b) (a + 2b)
you measure that it takes 0.75 seconds for a leaf to fall from a tree to the ground. the leaf experiences air resistance as it falls. if there were no air resis
1)simplify the expression (2x)^42)the perimeter of a rectangular is twice the sum of its length and its width. the perimeter is 16 meters and its length is 2 me