Class ArrayGames

java.lang.Object
ArrayGames

public class ArrayGames extends Object
You now geet to read my JavaDoc in this assignmeant. This assignement will give you some practice in working with arrays.
  • Constructor Details

    • ArrayGames

      public ArrayGames()
  • Method Details

    • main

      public static void main(String[] args)
      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

      public static String[] snipAt(String[] arr, String snipPoint)
      Parameters:
      arr - an array of strings
      snipPoint - a string
      Returns:
      a copy of the subarray of arr snipped at snipPoint. If snipPoint is not present in the array, return a copy of the array.
    • swap

      public static void swap(String[] arr, int j, int k)
      Parameters:
      arr - an array of strings
      j - a valid index in the array
      k - a valid index in the array This swaps the entries of arr at indices j and k
    • soapy

      public static void soapy(int[] arr)
      Parameters:
      arr - an array of integers This walks up to each pair of neighboring elmeents of arr, 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

      public static void bigSoapy(BigInteger[] arr)
      Parameters:
      arr - an array of BigIntegers This walks up to each pair of neighboring elmeents of arr, 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.