O(1) algorithm to determine if node is descendant of another node in a multiway tree?
问题 Imagine the following tree: A / \ B C / \ \ D E F I'm looking for a way to query if for example F is a descendant of A (note: F doesn't need to be a direct descendant of A), which, in this particular case would be true. Only a limited amount of potential parent nodes need to be tested against a larger potential descendants node pool. When testing whether a node is a descendant of a node in the potential parent pool, it needs to be tested against ALL potential parent nodes. This is what a came