KGram, Permutation, Tree index