On the construction of classes of suffix trees for square matrices: Algorithms and applications