Skip to content

In-place [mp]

Micro pattern

Description

Reuse an input structure for output, metadata, or rearrangement instead of allocating an equivalent auxiliary structure.

Problems

Arrays and matrices

Overwrite, swap, transpose, reverse, or partition elements in the input container.

Linked lists

Rewire existing nodes instead of representing the list with copied values.

Trees

Reuse existing pointers to traverse and link tree levels.

In-place marking

Overwrite cells temporarily or permanently to encode visitation or metadata.