Sort an integer array: Difference between revisions

Content added Content deleted
No edit summary
Line 990: Line 990:
return ((a as int) - (b as int));
return ((a as int) - (b as int));
end</lang>
end</lang>

=={{header|Eiffel}}==
Using a SORTED_TWO_WAY_LIST means that the contents of the list will be sorted ascending automatically.
The list can be easily sorted in reverse. There is a call for `sort' to manually initiate sorting.

<lang eiffel>
local
l_array: SORTED_TWO_WAY_LIST [INTEGER]
do
create l_array.make_from_iterable (<<9,8,7,6,5,4,3,2,1,0>>)
end
</lang>


=={{header|Elena}}==
=={{header|Elena}}==