first step is to model the problem
Try to understand, basically, what are the main elements of the problem that need to be solved
Find an algorithm to solve it.
Fast enough? Fits in memory?
if not ,fiugre out why.
find a way to address the problem.
lterate until satisfied.
So, first we’ll talk about the dynamic connectivity动态连接性 problem, the model of the problem for union find.
- Union Command:
connect two objects.
- Find/connected query:
is there a path connecting the two objects?
Q. Is there there a path connecting p and q?
- Pixels in digital photo.
- Computers in a network.
- Friends in a social network.
- Transistors in a computer chip.
- Elements in a mathematical set.
- Variable names in Fortran program
- Metallic sites in a composite system.