Question: Use good decomposition ( i . e . functions with arguments and / or return values ) to solve the following problems in java. You
Use good decomposition ie functions with arguments andor return values to solve the following problems in java.
You may choose how to populate arrayslists with values ie hardcoded, randomly generated, read from a file, specified on the command line, or entered interactively. Use sufficient messages so that the programs user knows what to do
You may use primitive arrays or ArrayLists. If no data type is specified, you can use any type.
You may implement all the solutions in a single, menudriven client, implement separate solutions in different programs, or group solutions as you see fit.
Determine true or false whether an array or list has duplicates. The duplicated values need not be adjacent. Demonstrate your solution on lists with and without duplicates.
Determine true or false whether an array or list is sorted in ascending order. Demonstrate your solution on sorted and unsorted lists.
From two arrays or lists of the same data type, produce a list containing only those elements that belong to both of the originals.
From an array or list of numbers either integers or doubles find the starting index of the longest strictly ascending subsequence. For example, given the array
the result is since the subsequence starts at index and is the longest that is strictly increasing. If the list does not have a strictly ascending subsequence eg the list is in descending order return a negative value.
Starting with a String and a single character, produce a list of the indexes in the string where the character occurs. For example, given the string bookkeeper and e the function would return since e occurs at those positions. Return an empty list if the character does not appear in the string at all.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
