fn calc_newest_trunk(bmap: &HashMap<usize, usize>) -> (usize, usize) {
    let mut data: Vec<_> = bmap.iter().collect();
    data.sort_by_key(|x| (x.1, x.0));
    data.last().map(|v| (*v.0, *v.1)).unwrap()
}
/// find the fork with the highest count of nodes that have it as an ancestor
/// as well as with the highest possible fork id, which indicates it is the newest
find the fork with the highest count of nodes that have it as an ancestor
as well as with the highest possible fork id, which indicates it is the newest
find the fork with the highest count of nodes that have it as an ancestor as well as with the highest possible fork id which indicates it is the newest
fn calc_newest_trunk(bmap: &HashMap<usize, usize>) -> (usize, usize) {
    let mut data: Vec<_> = bmap.iter().collect();
    data.sort_by_key(|x| (x.1, x.0));
    data.last().map(|v| (*v.0, *v.1)).unwrap()
}
fn calc_newest_trunk ( bmap : & HashMap < usize , usize > ) -> ( usize , usize ) { let mut data : Vec < _ > = bmap . iter ( ) . collect ( ) ; data . sort_by_key ( | x | ( x . 1 , x . 0 ) ) ; data . last ( ) . map ( | v | ( * v . 0 , * v . 1 ) ) . unwrap ( ) }
find the fork with the highest count of nodes that have it as an ancestor
as well as with the highest possible fork id, which indicates it is the newest
find the fork with the highest count of nodes that have it as an ancestor as well as with the highest possible fork id which indicates it is the newest
bmap
&HashMap<usize, usize>