I want to build a suffix array and handle these queries:
1.word search in a text
2.longest common prefix of two suffixes(LCP)
so after making the suffix array,I want to do these requests by receiving a text from the user as mentioned below
receive a word and count the repetition of that word in the text
find the minimum lexicographical rotation
now I don't know after building the suffix array,how I should construct the sparse table to do the queries efficiently.
and whether I have to build several sparse tables or one sparse table and how I should make these sparse tables.