Const qualifiers in frequency calculation arguments are unnecessary.
Loop index as size_t.