Top "In-place" questions

Use this tag on questions about algorithms that modify the data in-place, as opposed to making a copy.

Sorting in linear time and in place

Suppose that n records have keys in the range from 1 to k. Write an algorithm to sort the records in …

algorithm sorting time-complexity space-complexity in-place
Does numpy reshape create a copy?

Is there a way to do a reshape on numpy arrays but inplace. My problem is that my array is …

numpy reshape in-place memory-consumption
Difference between a -= b and a = a - b in Python

I have recently applied this solution for averaging every N rows of matrix. Although the solution works in general I …

python arrays numpy variable-assignment in-place
How to in-place initialize an array?

How can I initialize an array without copy or move-constructing temporary elements? When the element has an explicitly deleted copy …

c++ arrays in-place copy-elision deleted-functions
Algorithm to apply permutation in constant memory space

I saw this question is a programming interview book, here I'm simplifying the question. Assume you have an array A …

arrays algorithm permutation in-place