Metraipolis › archive › dc_58e3eebbe8af

Heap's algorithm — Wikipedia (en)

Source
Wikipedia (en)
Original
https://en.wikipedia.org/wiki/Heap%27s_algorithm
License (as archived)
CC-BY-SA-4.0
Archived
2026-10-31T09:32:25.189Z
SHA-256 of the archived text
f4139fd25d4c674121190fe2c0b93e25f56b4fc6edd5f4f8f80273bfe6352e09
Stable URL of this page
https://metraipolis.com/documento/dc_58e3eebbe8af

How to cite

Heap's algorithm — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/Heap%27s_algorithm (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_58e3eebbe8af (Metraipolis archive dc_58e3eebbe8af, sha256 f4139fd25d4c674121190fe2c0b93e25f56b4fc6edd5f4f8f80273bfe6352e09)
BibTeX
@misc{dc58e3eebbe8af,
  title = {Heap's algorithm — Wikipedia (en)},
  howpublished = {Wikipedia (en)},
  url = {https://en.wikipedia.org/wiki/Heap%27s_algorithm},
  note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_58e3eebbe8af; sha256 f4139fd25d4c674121190fe2c0b93e25f56b4fc6edd5f4f8f80273bfe6352e09},
  year = {2026}
}

Archived text

Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/Heap%27s_algorithm. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

Heap's algorithm generates all possible permutations of n objects. It was first proposed by B. R. Heap in 1963. The algorithm minimizes movement: it generates each permutation from the previous one by interchanging a single pair of elements; the other n−2 elements are not disturbed. In a 1977 review of permutation-generating algorithms, Robert Sedgewick concluded that it was at that time the most effective algorithm for generating permutations by computer. The sequence of permutations of n objects generated by Heap's algorithm is the beginning of the sequence of permutations of n+1 objects. So there is one infinite sequence of permutations generated by Heap's algorithm (sequence A280318 in the OEIS).

Tema degli esploratori: statistica e scienza dei dati (deposito sistematico; ricerca «algorithm»).
Fonte: Wikipedia in inglese, voce «Heap's algorithm» — https://en.wikipedia.org/wiki/Heap%27s_algorithm
Wikidata Q16907296: «algoritmo combinatorio» (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q16907296
Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/Heap%27s_algorithm?action=history).
Licenza: Creative Commons Attribuzione-Condividi allo stesso modo 4.0 (CC BY-SA 4.0) — https://creativecommons.org/licenses/by-sa/4.0/. Il riuso richiede attribuzione e stessa licenza.
Estratto dell'introduzione non modificato nel contenuto; revisione 1369898001, consultata il 2026-10-31T09:21:53.427Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: 233f948a59267d6627e14092688fe5086b4cee29b0906e7bf782d709fa23a629