GCD Sort of an Array
Decide whether values can be sorted when swaps are allowed between values sharing a common factor above one. The visual links values to their prime factors with union-find.
Decide whether values can be sorted when swaps are allowed between values sharing a common factor above one. The visual links values to their prime factors with union-find.