Skip to content

Reverse [mp]

Micro pattern

Description

Invert an ordering, direction, or sequence of links.

Problems

Reverse arrays or strings

Swap opposite positions or consume a slice in reverse order.

Reverse rows after transposition

Combine transposition with row reversal.

Reverse linked pointers

Redirect next pointers toward preceding nodes.

Reverse bit positions

Remove low bits and append them to the opposite end of a result.

Reverse negative ordering

Reverse sorted magnitudes before restoring negative signs.

Reverse graph edges

Build reverse adjacency to propagate information from destinations to predecessors.