| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| How can I sort an array or a linked_list? These classes do not provide sorting-routines. Thx |
|
#2
| |||
| |||
| Roman Töngi <roman.toengi@hispeed.ch> 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. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.