Search:

Type: Posts; User: laserlight

Search: Search took 0.86 seconds.

  1. The idea is that once you have sorted them, the...

    The idea is that once you have sorted them, the adjacent elements will be grouped together. Therefore, if you do not need the count for later use, you can count them and print the count immediately...
  2. Oh... actually yeah: since the instruction is to...

    Oh... actually yeah: since the instruction is to sort first, a mapping container is not needed if all you are going to do is to print the mapping immediately after computing the frequency. On the...
  3. Basically, you need to map each distinct element...

    Basically, you need to map each distinct element of the array to its frequency. The generic easy way is to just use a std::map or std::unordered_map. In this case though, if the elements of the array...
Results 1 to 3 of 3