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

what are 3 parts of observation?
Please help me anyone ???????
How do u solve 1-r=-5
what does tropic of capricorn
If a dune Buggy is traveling for 20 seconds at a speed of 8.5m/s how do I calculate the unknown quantities
How do you calculate 24 3/8 - (-54 1/8)=
why is it not useful to view science as a set of facts ?
the midwest is one region of the United states. what characteristics make it a region
Please help. What mass of copper is required to replace silver from 4.00g of silver nitrate dissolved in water? I found the molar mass of all of them but don't
What action caused the greatest human loss for Napoleon’s army?