Write a function named "isBoundedArray" that accepts an array of integers and its size. The function will check the array to see whether the first and the last elements in the given array are the smallest and largest in the list, or the largest and smallest in the list. If they are, it will return true. Otherwise, it will return false. Requirement: please use only pointer notation in the function. No array notation. For example, the following arrays will return true int numList0[] = {10} ; int numList1[] = {10, 20, 30, 40} ; int numList2[] = {40, 30, 20, 10} ; int numList3[] = {10, 30, 20, 40} ; int numList4[] = {40, 20, 30, 10} ; And these arrays will return false int numList5[] = {10, 40, 20, 30} ; int numList6[] = {40, 20, 30, 50} ;
Write a function named "isBoundedArray" that accepts an array of integers
and its size. The function will check the array to see whether the first and the last elements
in the given array are the smallest and largest in the list,
or the largest and smallest in the list.
If they are, it will return true. Otherwise, it will return false.
Requirement: please use only pointer notation in the function. No array notation.
For example, the following arrays will return true
int numList0[] = {10} ;
int numList1[] = {10, 20, 30, 40} ;
int numList2[] = {40, 30, 20, 10} ;
int numList3[] = {10, 30, 20, 40} ;
int numList4[] = {40, 20, 30, 10} ;
And these arrays will return false
int numList5[] = {10, 40, 20, 30} ;
int numList6[] = {40, 20, 30, 50} ;
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)