public void construct() {
			for (int i = 0; i < n; i++) {
				sA[i] = new Node(i, cad[i]);
			}
			int prev;
			int rank = 0;

			Arrays.sort(sA);

			int ind[] = new int[n];
			for (int i = 2; i <= 2 * n; i <<= 1) {

				rank = 0;
				prev = sA[0].rank;
				sA[0].rank = 0;

				for (int j = 1; j < n; j++) {

					if (sA[j].rank == prev
							&& sA[j].nextRank == sA[j - 1].nextRank) {
						prev = sA[j].rank;
						sA[j].rank = rank;
					} else {
						prev = sA[j].rank;
						sA[j].rank = ++rank;
					}
					ind[sA[j].index] = j;
				}

				for (int j = 0; j < n; j++) {

					if (sA[j].index + i < n) {
						sA[j].nextRank = sA[ind[sA[j].index + i]].rank;
					} else {
						sA[j].nextRank = -1;// cuando al doblar no hay rank
					}
				}

				Arrays.sort(sA);

			}

		}