Artificial intelligent assistant

Thomas algorithm and pivoting $L_E = \begin{bmatrix} 1 && 0 && 0\\\ l_{21} && 1 && 0\\\ 0 && l_{32} && 1\\\ \end{bmatrix}$ and $U = \begin{bmatrix} u_{11} && u_{12} && 0\\\ 0 && u_{22} && u_{23}\\\ 0 && 0 && u_{33} \end{bmatrix}$ I am using Thomas algorithm but i don't know how can i apply pivoting(in tridiagonal matrix). Does pivoting a tridiagonal matrix has effect on the time complexity of Thomas algorithm for solving tri-diagonal matrix? I don't need a full solution but a tip will be enough.

The Thomas algorithm is Gaussian elimination without pivoting applied to a tridiagonal matrix. Try to do an LU factorization of a tridiagonal matrix using partial pivoting. First, do a small explicit example, then determine the distribution of the nonzero elements for $L$ and $U$. Assume the worst case, i.e., that you have to pivot every time. You will find that $L$ is lower bidiagonal, while $U$ is upper triangular with at most two nonzero superdiagonals. This information will allow you to determine the number of arithmetic operations needed in the worst case.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy b93ad3480b81c2186705ced1bd9a8373