This can be done efficiently if both solutions are computed at once, as the forward portion of the pure tridiagonal matrix algorithm can be shared.
If you want to compute both solutions efficiently, it's best to do so at the same time because the initial part of the pure tridiagonal matrix algorithm can be used for both calculations.