The PSP paper gives
two mode computations
(a) Use WYSIWYG
analysis to say which is better
(b) Create custom
maxmode to improve last line
-- Standard mode
code
[1..n] begin
S := 0;
for i := 1 to n do
[i..n] S += ((>>[i]
V) = V);
end;
count := max<< S; -- largest freq count
mode := max<<((count = S) * V); -- get mode
end;