Let . After each linear-time selection algorithm and partition, exactly elements are removed, so the successive input sizes are . Thus the standard efficient implementation takes
Here selection can use median of medians for worst-case linear time; a suitable randomised linear-time selection routine gives the same bound in expectation. Merely sorting each remaining array would introduce an avoidable logarithmic factor.

Articles by others on the same topic (0)

There are currently no matching articles.