On the Construction of Classes of Suffix Trees for Square Matrices: Algorithms and Applications