I am solving this DIV 2C. This is my submission which got accepted.
My question is this:
Why isn't updating the parent of a node, an O(n) operation ?
Question regarding time complexity
I am solving this DIV 2C. This is my submission which got accepted.
My question is this:
Why isn't updating the parent of a node, an O(n) operation ?