The input/output complexity of sorting and related problems
Communications of the ACM
Journal of Algorithms
External memory algorithms and data structures: dealing with massive data
ACM Computing Surveys (CSUR)
A locality-preserving cache-oblivious dynamic dictionary
SODA '02 Proceedings of the thirteenth annual ACM-SIAM symposium on Discrete algorithms
Cache oblivious search trees via binary trees of small height
SODA '02 Proceedings of the thirteenth annual ACM-SIAM symposium on Discrete algorithms
External memory data structures
Handbook of massive data sets
FOCS '99 Proceedings of the 40th Annual Symposium on Foundations of Computer Science
FOCS '00 Proceedings of the 41st Annual Symposium on Foundations of Computer Science
Binary search trees of bounded balance
STOC '72 Proceedings of the fourth annual ACM symposium on Theory of computing
Tradeoffs between branch mispredictions and comparisons for sorting algorithms
WADS'05 Proceedings of the 9th international conference on Algorithms and Data Structures
Dichotomic Search Protocols for Constrained Optimization
CP '08 Proceedings of the 14th international conference on Principles and Practice of Constraint Programming
Branch mispredictions don't affect mergesort
SEA'12 Proceedings of the 11th international conference on Experimental Algorithms
Hi-index | 0.00 |
It is well-known that to minimize the number of comparisons a binary search tree should be perfectly balanced. Previous work has shown that a dominating factor over the running time for a search is the number of cache faults performed, and that an appropriate memory layout of a binary search tree can reduce the number of cache faults by several hundred percent. Motivated by the fact that during a search branching to the left or right at a node does not necessarily have the same cost, e.g. because of branch prediction schemes, we in this paper study the class of skewed binary search trees. For all nodes in a skewed binary search tree the ratio between the size of the left subtree and the size of the tree is a fixed constant (a ratio of 1/2 gives perfect balanced trees). In this paper we present an experimental study of various memory layouts of static skewed binary search trees, where each element in the tree is accessed with a uniform probability. Our results show that for many of the memory layouts we consider skewed binary search trees can perform better than perfect balanced search trees. The improvements in the running time are on the order of 15%.