public class QuickSorter {
  /**
   * Sort an array using the `quicksort' algorithm.
   * @param array The array to sort.
   */
  public void sort(Integer[] array) {
    quicksort(array, 0, array.length - 1);
  }

  /**
   * Quicksort recursive algorithm
   * @param array The array to sort.
   * @param start The start of the sub array that we are sorting
   * @param end The end of the sub array that we are sorting
   */
  private void quicksort(Integer[] array, int start, int end) {
    /* Part II: For you to complete */
  }

  /**
   * Partition the array around a pivot value.
   * @param array The array to partition
   * @param start The position to begin the partitioning from
   * @param end The position to end the partitioning at
   */
  public int partition(Integer[] array, int start, int end) {
    /* Part I: For you to complete */
  }


  /**
   * Find a 'good' pivot value within a sub array.
   * @param array The total array
   * @param start The beginning of the sub array
   * @param end The end of the sub array
   */
  private int getPivotIndex(Integer[] array, int start, int end) {
    return start;
  }

  /**
   * Swap two items within the array.
   * @param array The array in which to swap the elements
   * @param first The index of the first item
   * @param second The index of the second item.
   */
  private void swap(Integer[] array, int first, int second) {
    Integer temp = array[first];
    array[first] = array[second];
    array[second] = temp;
  }

  /**
   * Prints the elements of the array, delimited by spaces.
   */
  public void printCollection(Integer[] items) {
    for (int i = 0; i < items.length; i++) {
      System.out.print(items[i] + " ");
    }
    System.out.println();
  }
}
