Lab04 Arrays
Lab04 Arrays
Lab04 Arrays
2. Create a class named TestArrayList to call mehods from class ArrayList. Class TestArray
has the following fields:
- ArrayList arr = new ArrayList();
Implement the following methods which will invoke methods of Array class for processing:
- Input n integer numbers of an Array object (arr)
- Output an Array object
- Caculate the sum of array elements which is divisible by 2 and 5.
- Caculate the last minimum sum of two consecutive elements
- Caculate the average of odd array elements
- Count the number of prime array elements
- Check if the given array is a symmetric array or not
- Check if the given array is increasing
- Delete negative array elements
- Given an increasing array. Insert into that array x value to make it remain increasing
- Reverse the array elements
- Find the longest increasing subsequence of an integer sequence
- Find the longest subsequence which is the longest arithmetic progression of an integer
sequence
- Find the longest sawtooth sequence in an integer sequence
- Sort the array to make it increasing
- Sort the given array to make a new one that contains even and divisible by 3 elements
at the beginning, odd and divisible by 3 elements at the end and the remains in the
middle.