Question: An array is defined to be stepped if it is in ascending order means a[n]
An array is defined to be stepped if it is in ascending order means a[n] <=a[n+1]. It does not mean a[n]. Write a function named is steeped that returns 1 if its array arguments is stepped otherwise return 0.
Example: {1,1,1,5,5,5,8,8,8} returns 1
{1,1,5,5,5,5,5,8,8,8} returns 0, even though its in ascending order, there are only two occurence of value 1
{3,3,3,2,2,2,1,1,1} returns 0, because its not in ascending order
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
