pub fn leaf_count(&self) -> usize {
        self.vertices
            .iter()
            .filter(|a| a.degree() == 1)
            .count()
    }
/// Count number of leaves in the graph, i.e. vertices with exactly one neighbor
Count number of leaves in the graph, i.e. vertices with exactly one neighbor
Count number of leaves in the graph i . e . vertices with exactly one neighbor
pub fn leaf_count(&self) -> usize {
        self.vertices
            .iter()
            .filter(|a| a.degree() == 1)
            .count()
    }
pub fn leaf_count ( & self ) -> usize { self . vertices . iter ( ) . filter ( | a | a . degree ( ) == 1 ) . count ( ) }
Count number of leaves in the graph, i.e.
Count number of leaves in the graph i . e .
&self
&self