def sort_012(input_list):
    """
    Given an input array consisting on only 0, 1, and 2, sort the array in a single traversal.

    Args:
       input_list(list): List to be sorted
    """
    if not input_list:
        return []

    if len(input_list) == 0 or len(input_list) == 1:
        return input_list

    lo = 0
    hi = len(input_list) - 1
    i = 0
    while i <= hi:
        num = input_list[i]
        if num == 0:
            input_list[i] = input_list[lo]
            input_list[lo] = 0
            lo += 1
            i += 1
        elif num == 2:
            input_list[i] = input_list[hi]
            input_list[hi] = 2
            hi -= 1
        elif num == 1:
            i += 1
    return input_list