Question: 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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!