Berggren's tree is an algorithm to find all Pythagorean triples, and it is closely related to the Rosen continued fraction and the even continued fraction algorithms. They provide procedures for Diophantine approximation on the unit circle as well as approximation by rationals of the specific parity. In this talk, we survey the three algorithms and discuss their connections to Diophantine approximation on the Hecke group H4. We also present an application of Diophantine approximation on H4 to the study of the dynamical properties of translation surfaces.