Is it possible to swap two elements of an array? for example like swap
rows in the matrix:
[1 5 7 3]
[2 6 2 5]
[6 5 1 7]
where I make a matrix as an array of arrays. where the inner arrays are
the rows of the matrix. so the above could be coded as:
A = [
[1,5,7,3],
[2,6,2,6],
[6,5,1,7]
];
rows in the matrix:
[1 5 7 3]
[2 6 2 5]
[6 5 1 7]
where I make a matrix as an array of arrays. where the inner arrays are
the rows of the matrix. so the above could be coded as:
A = [
[1,5,7,3],
[2,6,2,6],
[6,5,1,7]
];
Comment