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

In a coffee mixer there are 1 1\2 quarts of coffee. After Emma pours an equal amount of coffee into two cups. 3 1\2 cups of coffee remain in the mixer. How much
What president demonstrated the rule of law
Help me simplify this
Which of theses conditions will most likely exist when there is a slow down in the economy
-3x - 3y = -30 -2x + 7y = -2 (This is elimination)
Betsy, a recent​ retiree, requires ​$5000 per year in extra income. She has ​$70000 to invest and can invest in​ B-rated bonds paying 15​% per year or in a cer
Math help please..............
Plz help me with questions 9&10. Show your work and explain how you got your answer so I understand because I just don’t understand this math we’re doing.
An evaluation of head start found that benefits were apparent for children _____.
if you are planning to carry a large balance on your credit card, which of the following credit card features should you look for? A. Low APR B. Low balance tra