def tab_fibonacci(n):
    """
    A fibonacci function that uses tabulation.
    Start with the smallest problems and use returned values to calculate larger values.
    Bottom up approach. The complexity is O(n).
    """
    n = int(n)
    if n == 0 or n == 1:
        return n
    x = 0
    y = 1
    for each in range(n)[2:]:
        subSum = x + y
        x = y
        y = subSum
    return x + y