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

to find where the Amazon river meets the rainforest you would reference a
tonya runs 8 kilometers in 60 minutes. at this rate how long would it take her to run 2 kilometers?
what is the faction of 9.9108027
The settlement of the new world lasted how many years?
5r^2s^3 as a monomial
What is 0.5 as a fraction
In the construction of a new housing development, which factor of production can be categorized as land? a.the people working to develop the community b.bike pa
5 friends divide 3 bags of apples equally between them. write the division represented in this situation as a fraction.
8 divided by what equals 12?
What dynasty created a centralized government ruled by a strong monarch in China? Zhou Chin Han Chou