C++ Suffix Array Implementation