最近公共祖先检索做了优化,那么问题将可以在 Θ ( N ) {\displaystyle \Theta (N)} 的时间复杂度内解决. Gusfield, Dan. Algorithms on Strings, Trees and Sequences: Computer Science and Computational
The Machine Learning Approach MIT Press (2001) ISBN 978-0-262-02506-5 Gusfield, Dan. Algorithms on Strings, Trees, and Sequences: Computer Science and Computational