Question: Write code to the following questions: 1) Given an array of integers, return the sum of all the elements. 2) Given an array of integers,

Write code to the following questions:

1) Given an array of integers, return the sum of all the elements.

2) Given an array of integers, return a new array with the elements in reverse order so {1, 2, 3} becomes {3, 2, 1}.

3) Given an array of integers, return the median of the elements from the original array.

4) Given an array of integers, return the Quartile 1 and Quartile 3 values. (Quartile 1 is the median of the lower half, Quartile 3 is the median of the upper half).

5) Given an array of Strings, return the longest word.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!