mode method
Implementation
double mode() {
Map<double, int> map = occurrences();
int max = 0;
double mode = 0;
for (double key in map.keys) {
if (map[key]! > max) {
max = map[key]!;
mode = key;
}
}
return mode;
}
double mode() {
Map<double, int> map = occurrences();
int max = 0;
double mode = 0;
for (double key in map.keys) {
if (map[key]! > max) {
max = map[key]!;
mode = key;
}
}
return mode;
}