Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Long getMode() {
- if(this.mode == null) {
- long value = 0;
- for (long i = this.minimum; i <= this.maximum + 1; i++) {
- if (getFrequency(i) < getFrequency(i+1)) {
- value = i+1;
- }
- if (getFrequency(i) > getFrequency(i+1)) {
- value = value;
- }
- if (getFrequency(i) == getFrequency(i+1)) {
- value = -1;
- }
- }
- this.mode = value;
- }
- return this.mode;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement