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

Wednesday, September 15, 2010

Count sort - yehhaaa!

Count sort is very good to sort sequence of integer which has small range of values (in comparison with sequence length). Due to two assumptions - our sequence contains only integers and its values range is much less than amount of items in sequence, it's linear in time to the amount of items in input. It's much better than classic algorythms based on comparison, cause it doesn't use comparison in its work, so it overcomes traditional for comparing algorythms O(nlogn). Here is an implementation: Show/Hide

Monday, September 13, 2010

Merge implementation with predicate

I study algorythms carefully during last two weeks and as you probably know, many algorythm tasks require implementation of sorting procedure. There is a huge amount of various sorting algorythms, such as Quick Sort, Heap Sort and so on. But one of the easiest to implement is a Merge Sort. You can find its description somewhere. I implemented it several times - for ascending sorting, for descending sorting and so on, so finally i take time to implement it with any predicate you like. Here is an implementation:

Hide button test

I want to test hot to hide text here Show/Hide