I'm programming an algorithm for calculating the inverse of a polynomial in $(\mathbb{Z}/3\mathbb{Z})[X]/(X^N-1)$. In this ring of truncated polynomials, the maximum degree of a polynomial is $N-1$, so each polynomial is represented by an array of $N$ componentes that takes into acount all the coefficients of the powers of $X$ and the constant term.
However, the code I'm writing is based on the paper "Almost Inverses and Fast NTRU Key Creation", writen by Joseph H. Silverman, where the algorithm for this ring uses a polynomial $g(X)$ that is initialized as $g(X) := X^N-1$. At first, I represented this polynomial with an array of length $N+1$, but this seems to be wrong, because at some moment in the algorithm this polynomial must be exchanged with another one that has ony $N$ components, which I think it makes no sense.
What is the correct way of representing this $g(X)$? Could someone make a bit of explanation on the different operations that appear on this algorithm?