Commit 682dfad3 authored by Florian Kurpicz's avatar Florian Kurpicz

Resolved #2.

parent 90fb8db2
......@@ -828,9 +828,10 @@ static sais_index_type sais_main(const void *T, sais_index_type *SA,
/*---------------------------------------------------------------------------*/
int
sais(const unsigned char *T, int *SA, int* LCP, int n) {
sais(unsigned char *T, int *SA, int* LCP, int n) {
if((T == NULL) || (SA == NULL) || (LCP == NULL) || (n < 0)) { return -1; }
if(n <= 1) { if(n == 1) { SA[0] = 0; LCP[0] = 0; } return 0; }
T[n - 1] = 0;
return sais_main(T, SA, LCP, 0, n, UCHAR_SIZE, sizeof(unsigned char), 0,1);
}
......
......@@ -33,7 +33,7 @@ extern "C" {
/* find the suffix array SA of T[0..n-1]
use a working space (excluding T and SA) of at most 2n+O(lg n) */
int sais(const unsigned char *T, int *SA, int *LCP, int n);
int sais(unsigned char *T, int *SA, int *LCP, int n);
/* find the suffix array SA of T[0..n-1] in {0..k-1}^n
use a working space (excluding T and SA) of at most MAX(4k,2n) */
......
File deleted
......@@ -179,11 +179,11 @@ main(int argc, const char *argv[]) {
}
fclose(fp);
if (n < 256) printf("%s\n", T);
T[n-1]=0;
//if (n < 256) printf("%s\n", T);
/* int ii; */
/* for (ii=0;ii<n;++ii) printf("%i,", (int)T[ii]); printf("\n"); */
if (n < 256) printf("%s\n", T);
//if (n < 256) printf("%s\n", T);
int j;
/* for (j = 0; j < n; j++) printf("%i,", (int) T[j]); printf("\n"); */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment