Code for “sorting with Pthread” (with 4 threads):