Second Version

Taking as pivot not the first element of subarray but a random one