not sure what would satisfy you as "algebraic," however, Conway's topograph method, done with full detail (more than shown in his book) the way I have been drawing the diagram on this site, puts all sorts of numbers and labels on a drawing of $PSL_2 \mathbb Z.$ The construction of $u^2 - d v^2 = 1$ is incorporated into finding the matrix
$$
P =
\left(
\begin{array}{rr}
u & dv \\
v & u
\end{array}
\right)
$$
which generates the (oriented) automorphism group of
$$
G =
\left(
\begin{array}{rr}
1 & 0 \\
0 & -d
\end{array}
\right),
$$
that is
$$ P^T G P = G. $$
The example in Hatcher is 19,
$$
\left(
\begin{array}{rr}
170 & 39 \\
741 & 170
\end{array}
\right)
\left(
\begin{array}{rr}
1 & 0 \\
0 & -19
\end{array}
\right)
\left(
\begin{array}{rr}
170 & 741 \\
39 & 170
\end{array}
\right) =
\left(
\begin{array}{rr}
1 & 0 \\
0 & -19
\end{array}
\right).
$$
My scanner makes strange colors out of graph paper. That's life. The cycle of length six forms are the Gauss-Lagrange "reduced" forms equivalent to $x^2 - 19 y^2.$ I made a point of including the light blue numerical labels so that you could see where the reduced forms occur in the diagram. A form $\langle A,B,C \rangle$ is a pink value $A,$ a blue edge number $B$ (always positive, the little blue arrow indicates a sort of orientation) then a pink value $C,$ such that $AC < 0$ and $B > |A+C|.$ The fact that this description is equivalent to the usual definition of "reduced" is on page 37 of Franz's 2010 book, Theorem 1.36.

Let me put some links to my answers, then I will go look for publications, there is a new one by Hatcher, this was initiated in Conway, there was some helpful detail in Stillwell. See pages 70 and 71 in Hatcher for $d=19$ and the location of $P$ in the diagram. Oh, it appears that, after I had assumed he'd quit, Weissman is publishing his book, to be available in August 2017.
http://math.stackexchange.com/questions/81917/another-quadratic-diophantine-equation-how-do-i-proceed/144794#144794
http://math.stackexchange.com/questions/228356/how-to-find-solutions-of-x2-3y2-2/228405#228405
http://math.stackexchange.com/questions/342284/generate-solutions-of-quadratic-diophantine-equation/345128#345128
http://math.stackexchange.com/questions/487051/why-cant-the-alpertron-solve-this-pell-like-equation/487063#487063
http://math.stackexchange.com/questions/512621/finding-all-solutions-of-the-pell-type-equation-x2-5y2-4/512649#512649
http://math.stackexchange.com/questions/680972/if-m-n-in-mathbb-z-2-satisfies-3m2m-4n2n-then-m-n-is-a-perfect-square/686351#686351
http://math.stackexchange.com/questions/739752/how-to-solve-binary-form-ax2bxycy2-m-for-integer-and-rational-x-y/739765#739765 :::: 69 55
http://math.stackexchange.com/questions/742181/find-all-integer-solutions-for-the-equation-5x2-y2-4/756972#756972
http://math.stackexchange.com/questions/822503/positive-integer-n-such-that-2n1-3n1-are-both-perfect-squares/822517#822517
http://math.stackexchange.com/questions/1078450/maps-of-primitive-vectors-and-conways-river-has-anyone-built-this-in-sage/1078979#1078979
http://math.stackexchange.com/questions/1091310/infinitely-many-systems-of-23-consecutive-integers/1093382#1093382
http://math.stackexchange.com/questions/1132187/solve-the-following-equation-for-x-and-y/1132347#1132347 <1,-1,-1>
http://math.stackexchange.com/questions/1132799/finding-integers-of-the-form-3x2-xy-5y2-where-x-and-y-are-integers
http://math.stackexchange.com/questions/1221178/small-integral-representation-as-x2-2y2-in-pells-equation/1221280#1221280
http://math.stackexchange.com/questions/1404023/solving-the-equation-x2-7y2-3-over-integers/1404126#1404126
http://math.stackexchange.com/questions/1599211/solutions-to-diophantine-equations/1600010#1600010
http://math.stackexchange.com/questions/1667323/how-to-prove-that-the-roots-of-this-equation-are-integers/1667380#1667380
http://math.stackexchange.com/questions/1719280/does-the-pell-like-equation-x2-dy2-k-have-a-simple-recursion-like-x2-dy2
http://math.stackexchange.com/questions/1737385/if-d1-is-a-squarefree-integer-show-that-x2-dy2-c-gives-some-bounds-i/1737824#1737824 "seeds"
http://math.stackexchange.com/questions/1772594/find-all-natural-numbers-n-such-that-21n2-20-is-a-perfect-square/1773319#1773319