fn build_frequency_map(data: &Vec<u8>) -> HashMap<u8, i64> {
    let mut frequency_map: HashMap<u8, i64> = HashMap::new();
    for byte in data {
        match frequency_map.get_mut(&byte){
            Some(result) => {
                *result = *result + 1;
            }
            None => {
                frequency_map.insert(*byte, 1);
            }
        }
    }

    return frequency_map;
}
//Creates a HashMap containing Nodes with the frequency of every u8 in given String
Creates a HashMap containing Nodes with the frequency of every u8 in given String
Creates a HashMap containing Nodes with the frequency of every u8 in given String
fn build_frequency_map(data: &Vec<u8>) -> HashMap<u8, i64> {
    let mut frequency_map: HashMap<u8, i64> = HashMap::new();
    for byte in data {
        match frequency_map.get_mut(&byte){
            Some(result) => {
                *result = *result + 1;
            }
            None => {
                frequency_map.insert(*byte, 1);
            }
        }
    }
    return frequency_map;
}
fn build_frequency_map ( data : & Vec < u8 > ) -> HashMap < u8 , i64 > { let mut frequency_map : HashMap < u8 , i64 > = HashMap :: new ( ) ; for byte in data { match frequency_map . get_mut ( & byte ) { Some ( result ) => { * result = * result + 1 ; } None => { frequency_map . insert ( * byte , 1 ) ; } } } return frequency_map ; }
Creates a HashMap containing Nodes with the frequency of every u8 in given String
Creates a HashMap containing Nodes with the frequency of every u8 in given String
data
&Vec<u8>
data
&Vec<u8>