Re: [Vala] How to abort sorting in Gee.ArrayList?



On Sun, Jun 27, 2010 at 15:25:34 +0200, synkro wrote:
Most sorting algorithms don't like being aborted. Aborting sorting
also means that not perfectly sorted data is acceptable. I suggest
bubble sort, it's not fast but easily aborted.

Have you noticed the *millions of entries* statement? Than how can you even
think about bubble-sort?!?!

Obviously any algorithm would be equally easily cancellable unless it's
written as recursive function and even that wouldn't be too hard. Using the
vala support for async functions (remember, they are stopped and restarted at
the yield and cancelling just means not restarting them...) it should be
mostly simple.

-- 
                                                 Jan 'Bulb' Hudec <bulb ucw cz>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]