[Nottingham] Introduction and Java Question

Jason Liquorish jason at dropshock.com
Sun Oct 19 13:44:38 UTC 2008


On Sun, 19 Oct 2008 12:59:27 +0100 (BST)
Peter Chang <Peter.Chang at nottingham.ac.uk> wrote:

> On Sun, 19 Oct 2008, Jason Liquorish wrote:
> 
> > I have had a breakthrough and I can now find the most recurring
> > number in the array, my only problem now is if two or more numbers
> > occur the same amount of times I am not sure how to print them all
> > out.
> >
> > My code is here http://dpaste.com/85429/
> 
> There's an error in your code. You store the max frequency but not
> the index. Then you use "max" as an index (line 84).

I think I see what you mean, I have updated my code here
http://dpaste.com/85436/

> Easy way to find the modal points is scan through your frequency
> array and find the matches to "max".
I was using the frequency array to contain a number that indicates how
many times the number at that index occurs, then just print the index
of medianArray to return the number that is the mode.

> My main concern with your code is that you haven't specified whether
> the input numbers are integers or floating point numbers. If it's the
> latter, you should be looking at histogram binning.
This is totally new to me as we have not gone this in-depth/advanced
yet. I doubt we even will as it is only a Level 3 course.

-- 
Jason Liquorish <jason at dropshock.com>



More information about the Nottingham mailing list