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.