diff --git a/guide/english/algorithms/binary-search-trees/index.md b/guide/english/algorithms/binary-search-trees/index.md index 0a1f9501b7..90f09cc3a8 100644 --- a/guide/english/algorithms/binary-search-trees/index.md +++ b/guide/english/algorithms/binary-search-trees/index.md @@ -14,8 +14,8 @@ A binary search tree (BST) adds these two characteristics: 2. For each node, the values of its left descendent nodes are less than that of the current node, which in turn is less than the right descendent nodes (if any). -The BST is built upon the idea of the binary search algorithm, which allows for fast lookup, insertion and removal of nodes. The way that they are set up means that, on average, each comparison allows the operations to skip about half of the tree, so that each lookup, insertion or deletion takes time proportional to the logarithm of the number of items stored in the tree, `O(log n)`. However, some times the worst case can happen, when the tree isn't balanced and the time complexity is `O(n)` for all three of these functions. That is why self-balancing trees (AVL, red-black, etc.) are a lot more effective than the basic BST. +The BST is built on the idea of the binary search algorithm, which allows for fast lookup, insertion and removal of nodes. The way that they are set up means that, on average, each comparison allows the operations to skip about half of the tree, so that each lookup, insertion or deletion takes time proportional to the logarithm of the number of items stored in the tree, `O(log n)`. However, some times the worst case can happen, when the tree isn't balanced and the time complexity is `O(n)` for all three of these functions. That is why self-balancing trees (AVL, red-black, etc.) are a lot more effective than the basic BST. **Worst case scenario example:** This can happen when you keep adding nodes that are *always* larger than the node before (its parent), the same can happen when you always add nodes with values lower than their parents.