Class ArrayGames
java.lang.Object
ArrayGames
You now geet to read my JavaDoc in this assignmeant.
This assignement will give you some practice in working with arrays.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
ArrayGames
public ArrayGames()
-
-
Method Details
-
main
test your code here- Parameters:
args
- command-line arguments if you want them.
-
seccondLargest
public static int seccondLargest(int[] arr) - Parameters:
arr
- an integer array with at least two emements- Returns:
- the second largest element in the array
-
snipAt
- Parameters:
arr
- an array of stringssnipPoint
- a string- Returns:
- a copy of the subarray of
arr
snipped atsnipPoint
. IfsnipPoint
is not present in the array, return a copy of the array.
-
swap
- Parameters:
arr
- an array of stringsj
- a valid index in the arrayk
- a valid index in the array This swaps the entries ofarr
at indicesj
andk
-
soapy
public static void soapy(int[] arr) - Parameters:
arr
- an array of integers This walks up to each pair of neighboring elmeents ofarr
, starting at index 0 and swaps the two elements if they are not in ascending order. It continues until it bumps up against the end of the array.
-
bigSoapy
- Parameters:
arr
- an array ofBigInteger
s This walks up to each pair of neighboring elmeents ofarr
, starting at index 0 and swaps the two elements if they are not in ascending order. It continues until it bumps up against the end of the array.
-