graph.getSinks()

Return an array of all the leafs of the graph. Time complexity: O(|V|).