Parallel algorithms for recurrence and tridiagonal equations