entropy_bound
- corsort.entropy_bound(n)[source]
Gives an approximation of the information theoretical lower bound of the number of comparisons required to sort n items.
Cf. https://en.wikipedia.org/wiki/Comparison_sort
Examples
>>> print(f"{entropy_bound(10):.1f}") 21.8 >>> print(f"{entropy_bound(100):.1f}") 524.8 >>> print(f"{entropy_bound(1000):.1f}") 8529.4