From 93214303d4095dd56272087d8cd5eecfc2ef127e Mon Sep 17 00:00:00 2001 From: Jacob Kim <32784118+TheJacobKim@users.noreply.github.com> Date: Fri, 17 May 2019 09:44:45 +0900 Subject: [PATCH] Changed BST's worst run-time from O(log n) to O(n) (#31445) --- guide/english/algorithms/binary-search-trees/index.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/guide/english/algorithms/binary-search-trees/index.md b/guide/english/algorithms/binary-search-trees/index.md index de6aa5cbd0..f67a658391 100644 --- a/guide/english/algorithms/binary-search-trees/index.md +++ b/guide/english/algorithms/binary-search-trees/index.md @@ -66,13 +66,14 @@ Successors can be described as the node that would come right after the the curr - Trie (Radix tree) ### Runtime -**Data structure: Array** -- Worst-case performance: `O(log n)` +**Data structure: BST** +- Worst-case performance: `O(n)` - Best-case performance: `O(1)` - Average performance: `O(log n)` - Worst-case space complexity: `O(1)` Where `n` is the number of nodes in the BST. +Worst case is O(n) since BST can be unbalanced. ### Implementation of BST