Hi there!

Hi there!
My name is Michael Ivanov and i'm a Senior SDE/Software architect.
My CV - here. You can find articles and other blog posts on the main page. I also develop some free and commercial software - complete list is here.

Tuesday, September 21, 2010

Randomized Quick-sort

Quick-sort is another type of comparison sorting algorythm. It's much better than other comparing algorythms cause it doesn't require additional space for its work (unlike merge sort for example). It also has a good time of work in average case - O(n lgn) - that is best time for every comparing algorytm as you know. It's also has asymptotic n^2 time of work in worst case, that occurs rarely. Using randomization at the each step of algorytm helps to avoid receiving "pre-defined worst case", when our solution gives us worst time on a particular sequence. Here is an implementation of randomized qucik-sort: Show/Hide

No comments: