Question: PLEASE ANSWER QUICKLY URGENT QUESTION 2 12 points Save Answer A vertex v in a directed graph G is called a sink if: a. all
PLEASE ANSWER QUICKLY URGENT
QUESTION 2 12 points Save Answer A vertex v in a directed graph G is called a sink if: a. all other vertices of G have an edge that points to v, and b. no vertex in G, including vitself, has an edge that points from v. Given the (partial) definition of an adjacency matrix below, complete the C# method Sink which returns true if the given vertex v (name) is both found and a sink; false otherwise. Note that E[i,j] = -1 when the edge from i toj does not exist. State the worst-case time complexity of your Sink method using the big-Oh notation where n is the number of vertices. class Directed Graph { public string[] V{ set; get; } // Vertex list public int[] E { set; get; } // Adjacency matrix public int NumVertices { set; get; } public int MaxNumVertices { set; get; } // FindVertex // Returns the index of the given vertex (if found); otherwise returns -1 private int FindVertex (string name) {...} public bool Sink (string name) { ... } } For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
