Question
. For all programming tasks, it is not allowed to use any external libraries (import) if not stated otherwise. kindly make a single program of
. For all programming tasks, it is not allowed to use any external libraries ("import") if not stated otherwise.
kindly make a single program of all these question...don't use the built in function.
Implement in C++ the program ArrayUtility, which offers basic operations over one-dimensional arrays. All methods must be implemented as functions. The signature of the functions in the ArrayUtility program are the following:
Q. # 01:-int findMax(int[] A, int i, int j):
returns the maximum value occurring in the array A between position i and j.
Q. # 02:- int findMaxPos(int[] A, int i, int j):
returns the position of the maximum value in the array A between position i
and j.
Q. # 03:- int findMin(int[] A, int i, int j):
returns the minimum value in the array A between position i and j.
Q. # 04:- int findMinPos(int[] A, int i, int j):
return the position of the minimum value in the array A between position i
and j.
Q. # 05:- void swap(int[] A, int i, int j):
Swaps the elements in position i and j in the array A.
Q. # 06:- void shiftRight(int[] A, int i, int j):
shifts to the right all the elements of the array A starting from position i and until position j (i.e., moves the element in position k to position k + 1 for all i k < j, and leaves position i unchanged).
Q. # 07:- void shiftLeft(int[] A, int i, int j):
shifts to the left all the elements of the array A, from position j down to position i (i.e., moves the element in position k to position k 1 for all i < k j, and leaves the position j unchanged).
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