Made partition method public, to use it in quickselect.