Terminating character in suffix array

Revision en1, by terserah, 2015-12-05 14:21:57

Hi!

I just learned to implement suffix array. I got quite confused about why i need to add a terminating character to my input string such as a '$' or '#'. I tried solving problem without the terminating character, some got accepted, some got WA. Any comments? Thank you so much!

FYI, i learned suffix array from CP 3 by Steven and Felix Halim.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English terserah 2015-12-05 14:21:57 387 (published)