add cpp ver, modify to random qsort later.