Agorithm for mode in statistics

hello everybody,...
please help me to solve this problem :
i want to write the coding of statistics program but i confused to write the algorithm for searching the mode of some sample data...
would you mind helping me for solve this problem....

Comments

  • : hello everybody,...
    : please help me to solve this problem :
    : i want to write the coding of statistics program but i confused to write the algorithm for searching the mode of some sample data...
    : would you mind helping me for solve this problem....
    :

    If the data is integers, then create a 2d int array, dimension 1 is for value and dimension 2 is for frequency. For each item of raw data (from keyboard, file or something else), search the 2d array for its value. It is is already in the 2d array just increment its frequency. If its not in the array, add it and initialize its frequency to 1. When all done, just scan the array and select the row(s) with the highest frequency.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion