Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ programing question help A vertex which has incoming edges from all vertices

ID: 3570728 • Letter: C

Question

C++ programing question help

A vertex which has incoming edges from all vertices and has no outgoing edges is called a Universal sink. Write a function that returns true if there is a Universal sink in a graph, false otherwise.

Write a function that return true if a graph is connected, false otherwise.

Write a function that return true if a graph is complete, false otherwise.

Write a function that deletes a vertex from a graph (clearly, you must delete all incoming/outgoing edges as well !)

Write a function that returns true if there is at least one vertex that is not reachable

Explanation / Answer

OUTPUT: T rue if graph G has a universal sink; F alse otherwise
i ? 1 j ? 1
while i ? |V | and j ? |V |
if aij == 1
i = i + 1

else
j = j + 1
if i > |V |
return F alse
else if is sink(A, i) == F alse
return F alse
else return T rue

b)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote