Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Activity: Frequency count Graded Playground Autograder This is due on Tuesday, January 3 0 , 2 0 2 4 at 2 3 : 5 9
Activity: Frequency count
Graded Playground Autograder
This is due on Tuesday, January at : CST
You have not attempted this activity. You currently have for this activity.
In this question, you will count how often specific numbers appear in a D vector and store that information in a map. Your solution will require the application of multiple lesson topics you have seen so far!
You will finish implementing the function FrequencyCount. This function takes in a D vector of ints called dataset and a vector of specific numbers to count in that D vector called numbersofinterest This function returns a map where the keys are the specific numbers and values are those specific number's counts.
std::map FrequencyCount
const std::vector& dataset,
const std::vector& numbersofinterest;
Example
std::vector dataset
; declares initializes a nonrectangular D vector of ints
std::vector numbersofinterest
; declares initializes a vector of ints
The function, given the above inputs, should return a map that looks like:
where each tuple ie is a key value pair. So given the entry maps to In the context of this problem, that means that was counted times in the data set!
Things to Note
There will be no duplicate values in numbersofinterest.
dataset does NOT have to be rectangular see example above
Helpful Tips
Here is some code reminding you how to interact with a D vector:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started