Esempio n. 1
0
def main():
    """
    Main method
    :return:
    """
    s = QuickSort()
    num_list = read_in_list(input('Enter in location of file: '))
    p_type = validate_pivot_type(input('Enter in which type of pivot you want to use: '))
    if p_type == 'first':
        s.first_quicksort(num_list, 0, len(num_list) - 1)
    elif p_type == 'last':
        s.end_quicksort(num_list, 0, len(num_list) - 1)
    else:
        s.mid_quicksort(num_list, 0, len(num_list) - 1)
    print(num_list)
    print("Count: ")
    s.get_count()
    s.reset_count()