Question
Write a function named isBoundedList that accepts an array of integers and its size. The function will determine whether the given array is a bounded
Write a function named "isBoundedList" that accepts an array of integers and its size. The function will determine whether the given array is a bounded list or not.
A bounded list is when the first number is the smallest and the last number is the largest or the first number is the largest and last number is the smallest. It will return true if it is and false otherwise.
For example, if the array is {111, 333, 222, 444} or {444, 222, 333, 111}, it will return true. If the array is {222, 333, 444, 111} or {444, 111, 333, 222}, it will return false.
Please note that an array of only one number will always return true.
Please write in C++
Array Notation
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