Algorithm: optimal way to rearrange a list from one order to another?

后端 未结 4 1032
旧巷少年郎
旧巷少年郎 2020-12-30 13:30

EDIT: I\'m not sure that my original question is clear enough. I need an algorithm that will compute the minimal sequence of moves to rearrange an array from one ord

4条回答
  •  没有蜡笔的小新
    2020-12-30 14:28

    Knuth Volume 3 has a section on "sorting networks". He doesn't go into a lot of detail about how to construct minimum comparison networks, but does cite some work (e.g., by Batcher and himself) about how to construct them. Note that while these are notes as "minimum comparison networks", few (if any) of them has really been proven to be minimal -- they're attempts at minimizing the number of comparators needed, but not necessarily successful in terms of actually achieving the true minimum.

提交回复
热议问题