3 ms·
> What I'm calling a "binary tree" here is normally called a binary search tree. This is because it associates keys with values. Standard binary trees usually
by tantalor 15y ago
> What I'm calling a "binary tree" here is normally called a binary search tree.
This is because it associates keys with values. Standard binary trees usually skip the values.
I wonder why BST are not implemented as a standard binary tree plus a hash table. I suppose the trade off depends on the size of the values.
- ggchappell 15y ago>> What I'm calling a "binary tree" here is normally called a binary search tree. > This is because it associates keys with values. Standard binary trees usually skip the values. Don't think so. A Binary Search Tree is a Binary Tree in which an inorder traversal goes through the data -- keys, in this case -- in sorted order. Of course, usefulness dictates that keys typically have associated values, but they do not have to be there, for it to be a BST. (Why have keys with no associated values? That's one way to represent a set.)
- tantalor 15y agoWell put.