You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated MRCA algorithm to be faster when the MRCA is relatively lower in the tree
Before, when looking for the MRCA of n nodes, I would do a complete upward traversal for the first n-1 nodes, and on the n-th upward traversal, I would stop the moment I found a node that's been visited n times (which is the MRCA)
Now, I use a queue to explore the tree upwards from the given nodes until finding a node that has been visited n times