int **tc; // or even unsigned char **tc
would be significant.
We could improve the actual cost by implementing as
BitMap tc;
which uses just one bit for each entry in the TC.
Note: does not improve asymptotic behaviour