During the traversal, we adjust the $\verb|left|$ pointer of each node to point to its predecessor and the $\verb|right|$ pointer to point to its successor.
Since we visit each node exactly once and perform $O(1)$ pointer adjustments per node, the total time complexity is $\Theta(n)$.
A complete binary tree with $n$ nodes has a height of $\text{floor}(\log _2 n)$