Write a method called range that returns the range of values in an array of integers. The
Question:
Write a method called range that returns the range of values in an array of integers. The range is defined as 1 more than the difference between the maximum and minimum values in the array. For example, if an array called list contains the values [ 36, 12, 25, 19, 46, 31, 22 ] , the call of range(list) should return 35 (46 - 12 + 1). You may assume that the array has at least one element.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Question Posted: