x is always equal to the last element of the table,
so when the function is called for the first time (j=data.lenght-1), j
is never decremented in the 'while (data[j]>x)' loop,
and then quicksort is recursively called with boundaries: left, j =data.lenght-1 boundaries.
You must take 'x' from somwhere between 'left' and 'right' boundaries.