Minimum Number of Operations to Sort a Binary Tree by Level
Sorting a level by swaps needs one swap per element outside each permutation cycle, so each cycle of length k costs k minus one.
Sorting a level by swaps needs one swap per element outside each permutation cycle, so each cycle of length k costs k minus one.