Fully Retroactive DSU

Revision en1, by brokie, 2024-04-18 10:15:36

Hello everyone! I am trying to solve the following problem:

You are given a DSU (Union Find) data structure, and you need to do the following queries efficiently:

  • Go back to time t, and insert a union operation (Union(u, v, t)) at time t.
  • Undo the union at time t.
  • Given time t, and two nodes u, v check if nodes u and v are in the same connected component at that time.

Any help or offline / online solution would be perfect!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English brokie 2024-04-18 10:15:36 464 Initial revision (published)