Programming, Computer Science, Graph Theory, Graph, Mathematics.
total sum of all in degrees does not match the total sum of all out degrees then it is not a tree. If you have 2 out-degrees and 1 in-degree it is not a tree since there is an edge either travelling nowhere or travelling to the same node twice. A directed graph can be represented by an adjacency