Notice the way the scan first sweeps the entire array and then works on smaller sections. Also notice the way that the pivot hops around. No matter how long you look at the resulting animation you can’t help but be impressed by first how fast the Quicksort runs, how it induces global order very quickly and how it makes very good use of it at every stage.

Some conclusions

You can continue to add sorting routines to the lab and you can add additional options to vary how it all works.

What is interesting is that implementing these standard algorithms with some coded animation reveals the problems in creating a good Silverlight app. You can't simply put everything in the UI thread. The BackgroundWorker approach to multi-threading seems good at first but it quickly becomes over complex compared to the direct approach.

Silverlight lacks a fully developed Dispatcher class and this makes it very difficult to create complex synchronizations. In particular the lack of Invoke means that you cannot easily create a sensible producer consumer relationship between the non-UI and UI thread. The best solution for the moment is to use the SynchronizationContext class and its Despatcher oriented derivative.