Are duplicate keys allowed in the definition of binary search trees?

后端 未结 12 915
慢半拍i
慢半拍i 2020-11-29 15:40

I\'m trying to find the definition of a binary search tree and I keep finding different definitions everywhere.

Some say that for any given subtree the left child k

12条回答
  •  醉酒成梦
    2020-11-29 16:22

    The elements ordering relation <= is a total order so the relation must be reflexive but commonly a binary search tree (aka BST) is a tree without duplicates.

    Otherwise if there are duplicates you need run twice or more the same function of deletion!

提交回复
热议问题