public Integer[] createSuffixArray(char str[]){
    
        SuffixSort sort = new SuffixSort(str);
        Integer suffix[] = new Integer[str.length];
        for(int i=0; i < suffix.length; i++){
            suffix[i] = i;
        }
        Arrays.sort(suffix,sort);
        return suffix;  
    }
http://www.geeksforgeeks.org/suffix-array-set-1-introduction/
src/com/interview/suffixprefix/SuffixArray.java