This preview shows page 1. Sign up to view the full content.
Unformatted text preview: alone the path from leaf to root, which takes O(log n). Clearly, heap is not efficient for operation MEMBER and DELETE. The recommended ADT will be 2-3 tree and AVL tree and Binary Search Trees if we can guarantee the randomness of data. Both 2-3 and AVL have O(log n) time worst case complexity for all three operations, Binary Search Trees have O(log n) average case complexity. There is no best implementation. If the amount of data is large, 2-3 tree and AVL tree are better. However, if the amount of data is small, heap can be a good implementation, because the overhead for the reconstruction of 2-3 tree and AVL tree is quite large. In addition, if, space efficiency is more concerned, AVL tree is better, because 2-3 tree requires more memory for interior nodes. If we can guarantee the randomness, binary search trees are the best....
View Full Document
- Spring '03