Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Function Name: marinaraTrench Inputs: 1. (double) An NxM array of depths Outputs: 1. 2. (double) The shallowest point of the trench (double) The deepest point
Function Name: marinaraTrench Inputs: 1. (double) An NxM array of depths Outputs: 1. 2. (double) The shallowest point of the trench (double) The deepest point of the trench Banned Functions: min(), max(), sort() Background: As we know, pirates roma the seas. "ba-dum-tsss Function Description: Given an array of trench depths, find and return both the shallowest and the deepest points of the trench, which will be the minimum and maximum values of the array, respectively. Trench depths will be represented by doubles. Example: trench [ 3.5, 6.5, 26.3, 90.3, 62.2 11.4, 14.5, 25.6, 82.1, 70.9 18.3, 24.2, 27.2, 100.4, 108.2 12.3, 3.2, 36.2, 92.5, 34.2 ]; [shallow, deep] -marinaraTrench (trench); shallow>3.2 deep 108.2 Notes: You only need to iterate through the array once. The array will have at least one element in it
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