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} ;

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section10.4: Passing Addresses
Problem 1E
icon
Related questions
Question

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} ;

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning