Fixing Freq, now main functions

This commit is contained in:
elvis
2025-07-02 07:30:05 +02:00
parent eba5d1266d
commit 2e16e2b002
6 changed files with 23 additions and 14 deletions

View File

@ -28,6 +28,10 @@ impl Frequency {
for &el in e.iter() {
self.frequency_map.entry(el).or_insert(vec![0; run + 1])[run] += 1
}
// TODO resize clones all prev values, replace with in place method
if self.totals.len() < run + 1 {
self.totals.resize(run + 1, 0);
}
self.totals[run] += 1
}