Question: Language is in Java, please explain the answer using comments, Thank you. I always rate!!! PLEASE DO NOT import any packages to solve the problem.

Language is in Java, please explain the answer using comments, Thank you. I always rate!!!

PLEASE DO NOT import any packages to solve the problem. PLEASE use classes and methods from java.lang.*, since they are automatically imported without import statement.

build a method called;

public static boolean decreasing3(int[] elems)

This method takes in an integer array and returns true if the array somewhere contains three continuously decreasing numbers.

Example:

Input: [10, 11, 12, 7, 6, 5]

Output: true

//Explanation: 7, 6, 5 are decreasing.

Input: [100, 5, 30, 18, 19, 40]

Output: false

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!