We describe an algorithm computing an optimal prefix free code for n unsorted positive weights in time within O ( n ( 1 + lg α ) ) ⊆ O ( n lg n ) , where the alternation α∈ [ 1 . . n − 1 ] approximates the minimal amount of sorti
Afshani et al. [37] described how minor variants of Kirkpatrick and Seidel’s algorithms [36] to compute convex hulls and maxima sets in two dimensions take optimally advantage of the positions of the input points, to the point that those algorithms are actually instance optimal among ...