n is less than 3, return the corresponding base case value (0, 1, or 1).a, b, and c with the base cases: a = 0, b = 1, c = 1.n, updating the values of a, b, and c to the next term in the sequence: temp = a + b + c, a = b, b = c, c = temp.c, which now holds the nth Tribonacci number.