pigeon hole algorithm

still need to use the pigeon hole algorithm to determine the KD
splitting position.