add in place algorithm partition()