Self-adjusting binary search trees
Journal of the ACM (JACM)
The Art of Computer Programming, 2nd Ed. (Addison-Wesley Series in Computer Science and Information
The Art of Computer Programming, 2nd Ed. (Addison-Wesley Series in Computer Science and Information
Worst-Case Optimal Adaptive Prefix Coding
WADS '09 Proceedings of the 11th International Symposium on Algorithms and Data Structures
Hi-index | 0.00 |
Although many authors have considered how many ternary comparisons it takes to sort a multiset S of size n, the best known upper and lower bounds still differ by a term linear in n. In this paper we restrict our attention to online stable sorting and prove upper and lower bounds that are within o(n) not only of each other but also of the best known upper bound for offline sorting. Specifically, we first prove that if the number of distinct elements @s=o(n/logn), then (H+1)n+o(n) comparisons are sufficient, where H is the entropy of the distribution of the elements in S. We then give a simple proof that (H+1)n-o(n) comparisons are necessary in the worst case.