Once the suffix array is constructed, the short routine shown in Figure 12.50 can be invoked from

Question:

Once the suffix array is constructed, the short routine shown in Figure 12.50 can be invoked from Figure 12.32 to create the longest common prefix array.
a. In the code, what does rank[i] represent?
b. Suppose that LCP[rank[i] ] = h. Show that LCP[rank[i+1] ] ‰¥ h ˆ’ 1.
c. Show that the algorithm in Figure 12.50 correctly computes the LCP array.
d. Prove that the algorithm in Figure 12.50 runs in linear time.
Figure 12.50 LCP array construction from suffix array
* Create the LCP array from the suffix array * @param s the input array populated from 0..N-1, with available pos N * @p
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: