when partition returns, all entries above the pth entry are larger than it, and those below are smaller

p = partition(i,j);