Question: Create a class called CIE106Finals. Inside the class, Implement the two methods; equalInHas(String str) and reOrder56(Int[] nums) described below. Use the main( ) to test
Create a class called CIE106Finals. Inside the class, Implement the two
methods; equalInHas(String str) and reOrder56(Int[] nums) described below.
Use the main( ) to test each of the two methods by storing there return
values Inside a variable and using println( ) to output the values In those
variables.
Write a static method reOrder56(int[] nums) that return an array
that contains exactly the same numbers as the given array, but
has been reorderd so that every 5 is immediately followed by a 6.
You may choose to move every other number with the exception of
5; You are not to move 5. The array contains the same number of
5's and 6's, every 5 has a number after it that is not a 5, and a
6 appears in the array before any 6.
e.g
reOrder56([1, 5, 1, 6]) [1, 5, 6, 1]
reOrder56([1, 5, 1, 6, 6, 5, 1]) [1, 5, 6, 1, 1, 5, 6]
reOrder56([5, 2, 2, 6]) [5, 6, 2, 2]
reOrder56([1]) [1]
reOrder56([]) []
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
