As we memtioned in the Application of Ternary Search Tree, a typical node structure of TST is
正如我们在Ternary Search Tree的应用中提到的那样,一个典型的TST结点的结构题如下
typedef struct tsnode { char c; struct tsnode * le, * eq, * gt; } tsnode, * tstree;
Its insertion and searching are really fast when the string in given strings set is short (I'm not going to define the exactly length of a string that we could say it's short, but we will see the decrement of running time after we applying the improvement). When the string length increases, the insertion and searching time grow, of course. The question is, we only compare one char at a time.
当给定输入集的字符串都比较短的时候(我并不打算定义低于多少个字节长才叫短,但是在应用了改进之后,我们将会明显看见运行时间的减少)。当字符串长度增加时,理所当然的,插入和搜索的时间也会增加。但问题在于,我们一次只比较了一个字符。