We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ml.js 中 function getCommonAncestor(el1, el2)函数 两个节点先求深度,深度大的向上走到深度小的节点同一深度。。。然后两个节点一起往上走,直到相遇。这样算法复杂度是否能小一点? 每次contains判断,(貌似)需要遍历整个子树,增加不必要的开销。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ml.js 中 function getCommonAncestor(el1, el2)函数
两个节点先求深度,深度大的向上走到深度小的节点同一深度。。。然后两个节点一起往上走,直到相遇。这样算法复杂度是否能小一点?
每次contains判断,(貌似)需要遍历整个子树,增加不必要的开销。
The text was updated successfully, but these errors were encountered: