# Why do binary search trees always insert into leaf nodes when inserting nodes

2022-01-27 00:02:15

Why do binary search trees always insert into leaf nodes when inserting nodes ？
Why do binary search trees always insert into leaf nodes when inserting nodes ？

First, find out whether the node to be inserted is in the tree , There is no need to insert , If you are not there, you need to insert .
If binary sort tree is empty , Then the newly inserted node is the new root node ; otherwise , The newly inserted node must be a new leaf node , The insertion position is determined by the position where the search is unsuccessful

exactly , This should be the rule , There is a norm later , To achieve it , In fact, I have this question ,mark, Ask for an answer .