Probabilistic comparing and sorting non-orthogonal quantum states