Consider a table $T$, where the elements $T[i][j], 0 \le i,j \le n$, represent the cost of the optimal solutions of different subproblems of a problem that is being solved using a dynamic programming algorithm. The recursive formulation to compute the table entries is as follows:
$T[0][k] = T[k][0] = 1$ for $k = 0,1,2, \dots, n$
$T[i][j] = 2T[i - 1][j] + 3T[i][j - 1]$ for $1 \le i,j \le n$
Consider the following two algorithms to compute entries of $T$. Assume that for both the algorithms, for all $0 \le i,j \le n$, $T[i][j]$ has been initialized to 1.
Algorithm $B_1$:
For $i = 1, 2, \dots, n$
For $j = 1, 2, \dots, n$
$T[i][j] = 2T[i - 1][j] + 3T[i][j - 1]$
Algorithm $B_2$:
For $s = 2, 3, \dots, 2n$
For $i = 1, 2, \dots, n$
For $j = 1, 2, \dots, n$
If ($i + j == s$)
$T[i][j] = 2T[i - 1][j] + 3T[i][j - 1]$
Algorithm $B_k, k \in \{1,2\}$ is said to be correct if and only if it calculates the correct values of $T[i][j]$, for all $0 \le i,j \le n$, (as per the recursive formulation) at the end of the execution of the algorithm $B_k$.
Which one of the following statements is true?