Question: Write an algorithm to print the minimum and maximum of an integer array. Your need to pass the array as a parameter. Since we
Write an algorithm to print the minimum and maximum of an integer array. Your need to pass the array as a parameter. Since we cannot return two values (in this case, minimum and maximum), just print them inside the method. You are allowed to use only one loop. i.e. you are not allowed to traverse the array twice. Note: You can write a Java method instead of pseudo-code but pseudo-code is preferred. Following is a template to start your pseudo code. MINMAX(A) min = ? max=? // Your code print min print mar Answer:
Step by Step Solution
There are 3 Steps involved in it
Pseudo code MINMAXA if Alength 0 pri... View full answer
Get step-by-step solutions from verified subject matter experts
