我正在尝试为一个程序编写伪代码,该程序可以计算分配的模式中位数和未排序数字的模式。我对如何获得均值有一个想法,但是对于模式和中位数,我完全迷失了,我放在下面的位置我在任何帮助下都会感激
诚实地说,我不知道如何尝试,因为我不知道伪代码是如何工作的,就像选择最常用的数字一样简单,但我不知道会有什么帮助
Start;
Initialise counter and sum to 0;
Do while there are more numbers;
Get the next number;
Add the number to sum;
Increment the counter;
Loop
Mean = sum/counter;
Display Mean;
End;
如果有人可以向我指出正确的方向,将不胜感激