Top "Swap" questions

Changing position of two items.

What are the number of swaps required in selection sort for each case?

I believe that selection sort has the following behavior: Best case: No swaps required as all elements are properly arranged …

sorting swap selection-sort
pandas how to swap or reorder columns

I know that there are ways to swap the column order in python pandas. Let say I have this example …

python pandas multiple-columns swap
How do I swap tensor's axes in TensorFlow?

I have a tensor of shape (30, 116, 10), and I want to swap the first two dimensions, so that I have a …

tensorflow axis swap axes permute
how to provide a swap function for my class?

What is the proper way to enable my swap in STL algorithms? 1) Member swap. Does std::swap use SFINAE trick …

c++ algorithm stl swap
Can I tell Linux not to swap out a particular processes' memory?

Is there a way to tell Linux that it shouldn't swap out a particular processes' memory to disk? Its a …

linux swap
Swap values in a tuple/list inside a list in python?

I have a list of tuples like this: [('foo','bar'),('foo1','bar1'),('foofoo','barbar')] What is the fastest …

python list tuples swap
How to swap keys with values in array?

I have array like: array( 0 => 'a', 1 => 'b', 2 => 'c' ); I need to convert it to: array( 'a', 'b', …

php arrays key swap
Swapping Axes in Pandas

What is the most efficient way to swap the axes of a Pandas Dataframe? For example, how could df1 be …

python indexing pandas swap
Best way to swap variable values in Go?

Is it possible to swap elements like in python? a,b = b,a or do we have to use: temp = …

go slice swap
Is there a better way to reverse an array of bytes in memory?

typedef unsigned char Byte; ... void ReverseBytes( void *start, int size ) { Byte *buffer = (Byte *)(start); for( int i = 0; i < size / 2; …

c++ memory swap std