This letter proposes a time-efficient algorithm applicable for time-varying wireless networks, which sorts a predefined number of elements in a large data set that are larger or smaller than the other or located between two parts. Based on the mean and standard deviation, a theoretical analysis for Gaussian, uniform, negative exponential, Rayleigh, and unknown distributions is presented, which finds exact and approximate thresholds. Then, the theoretical and numerical analyses show the superiority of the proposed algorithm to the well-known Merge, Quick, and K-S mean-based sorting algorithms in terms of the time complexity, the running time, and the similarity measure.