Re: Re-ordering columns or rows of an array efficiently



Dan Nagle wrote:

(I wrote)
You could do the rearrangement one row at a time, which requires
only one temporary row.

I think at worst he needs only two temporary vectors
to make whatever rearrangement he wants.

It can be done without any temporary vectors, but it will
be faster with one or two. The OP didn't say how many
rows or columns he had.

-- glen

.