private List<Integer> sortPartition(List<Integer> list, int low, int high) {

        // checking input parameter for null
        if (list == null) {
            return list;
        }

        int i = low, j = high;

        // Get the pivot element from the middle of the list
        int pivot = list.get(low + (high - low) / 2);

        // Divide into two lists
        while (i <= j) {
            // get the next element from the left if left list is smaller then the pivot
            while (list.get(i) < pivot) {
                i++;
            }

            // get the next element from right list if value from the right list is larger
            while (list.get(j) > pivot) {
                j--;
            }

            // swap if value found in the right list
            if (i <= j) {
                appUtil.swap(list, i, j);
                i++;
                j--;
            }
        }

        // Recursion
        if (low < j) sortPartition(list, low, j);
        if (i < high) sortPartition(list, i, high);
        return list;
    }