Frequency Array
How frequency array works and created
Introduction
A frequency array stores how many times each value appears. If we have an array and many questions like “how many times does value appear?”, we can first count all values once and then answer each question directly.
For example, in the array , the value appears times, the value appears times, and the value appears time. A frequency array keeps exactly this information.