efficient java code for sorting. Based on QSort algorithm.