laymanfai5409 laymanfai5409
  • 23-08-2019
  • Computers and Technology
contestada

)In a graph represented by adjacency matrix u can find all the neighbours of a given vertices in ____Operations

A. O(1)

B.O(n)

C.O(logn)

D.O(n2)

Respuesta :

ExieFansler ExieFansler
  • 26-08-2019

Answer:

B.O(n).

Explanation:

If the graph is represented by adjacency matrix then we can find all the neighbors of a given vertex in O(n) time because each row in adjacency matrix consists the track of the neighbors.If the other vertex is a neighbor then it contains 1 in adjacency matrix if not it contains 0.So we have to iterate over that row of the vertex to find the neighbors.

Answer Link

Otras preguntas

Find the 83rd term of the arithmetic sequence -23, -26, -29
(4-5i)(-2+7i) what is the answer
Zoe mows the lawn in the summer to earn extra money she usually charges $15 per week but she offers a special rate of $59.50 if a customer prepaid for 5 weeks.
From “Making Energy Drinks”, what is the ratio of drink mix to water? Please help I don’t want some bad grade, please lol.
Is the sister good or bad cold equation
[tex]1.005 = 0.005x + 0.95[/tex]
Why were Hardrada and Sweyn II fighting each other ?
Where was the first evidence of humans domesticating plants discovered?
The bold adjective describes which noun? Though he wouldn't admit it, Cesar Diaz felt sleepy as he listened to the speech.
Conner received a new puppy as a birthday gift. The puppy's food bowl was placed on a mat to keep spilled food off the floor, but every morning the food bowl wa