Metraipolis › archive › dc_e0060861f7fb

American flag sort — Wikipedia (en)

Source
Wikipedia (en)
Original
https://en.wikipedia.org/wiki/American_flag_sort
License (as archived)
CC-BY-SA-4.0
Archived
2026-11-08T21:57:47.948Z
SHA-256 of the archived text
8e3418792e02ed802f9f277c6f7cb4382bfad53c0f08a9cff605f23c47a12f71
Stable URL of this page
https://metraipolis.com/documento/dc_e0060861f7fb

How to cite

American flag sort — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/American_flag_sort (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_e0060861f7fb (Metraipolis archive dc_e0060861f7fb, sha256 8e3418792e02ed802f9f277c6f7cb4382bfad53c0f08a9cff605f23c47a12f71)
BibTeX
@misc{dce0060861f7fb,
  title = {American flag sort — Wikipedia (en)},
  howpublished = {Wikipedia (en)},
  url = {https://en.wikipedia.org/wiki/American_flag_sort},
  note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_e0060861f7fb; sha256 8e3418792e02ed802f9f277c6f7cb4382bfad53c0f08a9cff605f23c47a12f71},
  year = {2026}
}

Archived text

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

An American flag sort is an efficient, in-place variant of radix sort that distributes items into buckets. Non-comparative sorting algorithms such as radix sort and American flag sort are typically used to sort large objects such as strings, for which comparison is not a unit-time operation. American flag sort iterates through the bits of the objects, considering several bits of each object at a time. For each set of bits, American flag sort makes two passes through the array of objects: first to count the number of objects that will fall in each bin, and second to place each object in its bucket. This works especially well when sorting a byte at a time, using 256 buckets. With some optimizations, it is twice as fast as quicksort for large sets of strings. The name American flag sort comes by analogy with the Dutch national flag problem in the last step: efficiently partition the array into many "stripes".

Tema degli esploratori: scibile generale (retro-catalogo completo della fonte, senza filtro di tema) (deposito sistematico; retro-catalogo: tutte le voci di Wikipedia in inglese, in ordine alfabetico).
Fonte: Wikipedia in inglese, voce «American flag sort» — https://en.wikipedia.org/wiki/American_flag_sort
Wikidata Q4745457: «Variant of radix sort» (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q4745457
Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/American_flag_sort?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 1337169077, consultata il 2026-11-08T21:54:00.308Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: 4e5d828aa4ba8db33edb051ee836db731ce424f14d324589478d0f1aa7b3b859