List Operations
A) Complete the public static Java method "reverseList" below that is supposed to
reverse the order of the elements in an ArrayList of Strings.  To accomplish
this task, you are not allowed to use any additional Lists or Collections.

An ArrayList is an object, and when an object is passed to a method, what's
actually happening is that a copy of the reference to that object is passed
to the method.  This means that any changes made to the ArrayList by your
method will be reflected in the original ArrayList that was sent into your
method.  Therefore, your method should not return (or print) anything.

    public static void reverseList(ArrayList<String> listOfWords)
    {
        // [Your Code Goes Here]
    }


B) Complete the public static Java method "indexSmallest" below that is supposed
to return the index of the smallest value in an unordered ArrayList of Integers.
Assume that every element in the ArrayList is different.

    public static int indexSmallest(ArrayList<Integer> numberList)
    {
        // [Your Code Goes Here]
    }


C) Complete the public static Java method "compact" below that is supposed to move
the non-zero numbers in an array of integers to the front of the list.  The
existing order of the non-zero elements must be maintained.  Note that you are
not deleting any elements from the array; you are simply rearranging the order
of the integers in the list.  To accomplish this task, you are not allowed to
use any additional Lists or Collections.

For example, if the original list is
    0, 17, 42, 0, 13, 0, 0, 51, 20, 9, 0, 33
then the list after going through your method should be
    17, 42, 13, 51, 20, 9, 33, 0, 0, 0, 0, 0
The above is an example; your method should work with any array of integers.

An array is an object, and when an object is passed to a method, what's actually
happening is that a copy of the reference to that object is passed to the method.
This means that any changes made to the array by your method will be reflected
in the original array that was sent into your method.  Therefore, your method
should not return (or print) anything.

    public static void compact(int[] list)
    {
        // [Your Code Goes Here]
    }


You should put all of the above methods into a single file named "ListOperations.java".
You may find it helpful to create a 'main' method in that file from which you can
call and test your methods as you write them.


Advanced Option
Copy the "reverseList" method above, change the name to "sortList",
and modify your code to create a new (fourth) method that modifies
the ArrayList so that the words are in non-descending alphabetical
order.  You must create your own code to sort the words.  That is,
you may not use any external Java classes or methods to do the
sorting for you.