Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write functions to perform the indicated task. Most of the functions are short and can be written in a handful of lines. Each function should
Write functions to perform the indicated task. Most of the functions are short and can be written in a handful of lines. Each function should use the most optimal solution. Please test your functions within main(). Leave all your test code active in main() so it can be reviewed. maxInt - Accepts an integer vector and returns the maximum value stored in the vector minInt - Accepts an integer vector and returns the minimum value stored in the vector containsDups - Accepts an integer vector as parameter. Return a boolean, true if the vector contains the same integer at least twice, false if all values in the vector are unique. isSorted - Accepts an integer vector as parameter. Returns a boolean, true if the vector is sorted from smallest to largest, false if it is not sorted. Adjacent duplicate elements are allowed. A list of 1 or fewer elements is sorted. histogram - Accepts an integer vector and displays histogram of the values stored in that vector scaled to fit the page. To scale properly you will need to find the maximum integer stored in the vector. Assume 60 to 80 characters in width for the terminal You should use an asterisk "*" to represent the "bar" portion of the histogram. See Sample below
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