同等というより>>438>>430は全く同じだな
空でなければpartitionでsmallerとrestに分けて
それぞれを再帰でqsortしてconcatenate