Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
14
Task/Sort-an-integer-array/GAP/sort-an-integer-array.gap
Normal file
14
Task/Sort-an-integer-array/GAP/sort-an-integer-array.gap
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
a := [ 8, 2, 5, 9, 1, 3, 6, 7, 4 ];
|
||||
# Make a copy (with "b := a;", b and a would point to the same list)
|
||||
b := ShallowCopy(a);
|
||||
|
||||
# Sort in place
|
||||
Sort(a);
|
||||
a;
|
||||
# [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
|
||||
|
||||
# Sort without changing the argument
|
||||
SortedList(b);
|
||||
# [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
|
||||
b;
|
||||
# [ 8, 2, 5, 9, 1, 3, 6, 7, 4 ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue