This paper concentrates on the primary theme of Suppose you are given the adjacency matrix representation M of a directed graph G = (V,E). in which you have to explain and evaluate its intricate aspects in detail. In addition to this, this paper has been reviewed and purchased by most of the students hence; it has been rated 4.8 points on the scale of 5 points. Besides, the price of this paper starts from £ 30. For more details and full access to the paper, please refer to the site.
1. Suppose you are given the adjacency matrix representation M of a directed graph G = (V,E). Note that the size of M is Θ(n2). The goal here is to determine if there is a node of G with in-degree n−1 and out-degree 0 (that is, all other nodes point to it and it points to no other node). Give an algorithm to do this which runs in Θ(n) time (so not Θ(n2)). [5 points]
2. Suppose you work for a lab which is studying butterﬂies. It has a sample of n butterﬂies, L1,L2,...,Ln. The researchers have made a series of r determinations determining whether two butterﬂies belong to diﬀerent species. A determination is of the form (i,j), and it means that Li and Lj belong to diﬀerent species. Your job is to give an O(n+r) time algorithm to decide whether the determinations are consistent with the butterﬂies belonging to just two species. (Note: it is possible that they could belong to three or more species, but that is a separate question.) [5 points]