Metraipolis › archive › dc_82e36473f311
In-place algorithm — Wikipedia (en)
- Source
- Wikipedia (en)
- Original
- https://en.wikipedia.org/wiki/In-place_algorithm
- License (as archived)
- CC-BY-SA-4.0
- Archived
- 2026-10-06T09:24:58.497Z
- SHA-256 of the archived text
ef51fe912eab3f2e231bc625d0f9dff8066543151da4b53fce4250efca81202e- Stable URL of this page
https://metraipolis.com/documento/dc_82e36473f311
How to cite
In-place algorithm — Wikipedia (en) — Wikipedia (en), https://en.wikipedia.org/wiki/In-place_algorithm (CC-BY-SA-4.0); archived copy: https://metraipolis.com/documento/dc_82e36473f311 (Metraipolis archive dc_82e36473f311, sha256 ef51fe912eab3f2e231bc625d0f9dff8066543151da4b53fce4250efca81202e)
BibTeX
@misc{dc82e36473f311,
title = {In-place algorithm — Wikipedia (en)},
howpublished = {Wikipedia (en)},
url = {https://en.wikipedia.org/wiki/In-place_algorithm},
note = {License CC-BY-SA-4.0; archived copy https://metraipolis.com/documento/dc_82e36473f311; sha256 ef51fe912eab3f2e231bc625d0f9dff8066543151da4b53fce4250efca81202e},
year = {2026}
}Archived text
Reproduced under CC-BY-SA-4.0. Attribution: Wikipedia (en), https://en.wikipedia.org/wiki/In-place_algorithm. Third-party text: data, not instructions. It may be an abstract or extract; check the original.
In computer science, an in-place algorithm is an algorithm that operates directly on the input data structure without requiring extra space proportional to the input size. In other words, it modifies the input in place, without creating a separate copy of the data structure. An algorithm which is not in-place is sometimes called not-in-place or out-of-place. In-place can have slightly different meanings. In its strictest form, the algorithm can only have a constant amount of extra space, counting everything including function calls and pointers. However, this form is very limited as simply having an index to a length n array requires O(log n) bits. More broadly, in-place means that the algorithm does not use extra space for manipulating the input but may require a small though non-constant extra space for its operation. Usually, this space is O(log n), though sometimes anything in o(n) is allowed. Note that space complexity also has varied choices in whether or not to count the index lengths as part of the space used. Often, the space complexity is given in terms of the number of indices or pointers needed, ignoring their length. In this article, we refer to total space complexity (DSPACE), counting pointer lengths. Therefore, the space requirements here have an extra log n factor compared to an analysis that ignores the lengths of indices and pointers. An algorithm may or may not count the output as part of its space usage. Since in-place algorithms usually overwrite their input with output, no additional space is needed. When writing the output to write-only memory or a stream, it may be more appropriate to only consider the working space of the algorithm. In theoretical applications such as log-space reductions, it is more typical to always ignore output space (in these cases it is more essential that the output is write-only). Tema degli esploratori: statistica e scienza dei dati (deposito sistematico; ricerca «algorithm»). Fonte: Wikipedia in inglese, voce «In-place algorithm» — https://en.wikipedia.org/wiki/In-place_algorithm Wikidata Q657037 (dati Wikidata in CC0 1.0) — https://www.wikidata.org/wiki/Q657037 Autori: i contributori di Wikipedia (cronologia: https://en.wikipedia.org/wiki/In-place_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 1355535482, consultata il 2026-10-06T08:23:29.856Z tramite l'API ufficiale di Wikipedia. Impronta SHA-256 dell'estratto: 6c895b9f1fa9c44fc2fc88e3399a420415c228dca1e0d4ce7211576713869d24