by Friedrich Dominicus <just-for-news-frido@[EMAIL PROTECTED]
Oct 16, 2007 at 08:00 AM
Roman Töngi <roman.toengi@[EMAIL PROTECTED]
> writes:
> How can I sort an array or a linked_list?
> These classes do not provide sorting-routines.
Something along this lines will do:
class
APPLICATION
create
make
feature -- Initialization
make is
-- Creation procedure.
local
comparator : KL_COMPARABLE_COMPARATOR[INTEGER];
my_sorter : DS_ARRAY_QUICK_SORTER[INTEGER];
some_array: ARRAY[INTEGER];
do
create comparator.make;
create my_sorter.make(comparator);
some_array := <<1,2,-1,2,-10,-100>>;
print(some_array);
my_sorter.sort(some_array);
print(some_array);
end
end -- class APPLICATION
Regards
Friedrich
--
Please remove just-for-news- to reply via e-mail.