Time complexity: O(n^(log3/log1.5)). Slower than bubble sort. You need a lot of time spending here.
It looks like Bubble sort, isn't it?