def search_linears(a, x):
    """
    Returns the index of x in a if present, None elsewhere.
    """
    d = a[-1]
    a[-1] = x
    i = 0

    while a[i] != x:
        i += 1

    a[-1] = d
    if i == len(a) - 1 and d != x:
        return None
    else:
        return i