Composite number order lexicographic order

Composite number order lexicographic order

Method for constructing lexicographical order

Suffix: from the far right to the first position to the right of the current position

  • Speak numbers scan from right to left until the first descending number
  • Swap the smallest number in the suffix greater than the current position
  • Guaranteed suffix is ​​the smallest suffix

example

insert image description here

Guess you like

Origin blog.csdn.net/weixin_42173136/article/details/122161856