[
next
] [
prev
] [
prev-tail
] [
tail
] [
up
]
Online Equivalence class
definition of Equivalence relationship
a a. (Reflexivity)
a b if and only if b a. (Symmetry)
if a b and b c then a c. (Transitivity)
online equivalence class, also known union-find question.
method 1: use array
method 2: stimulate pointer
[
next
] [
prev
] [
prev-tail
] [
front
] [
up
]