Trie deletion time complexity.

Правка en1, от Francesco4203, 2022-06-07 16:36:52

Hi guys, I've just learned a Trie's delete algorithm, which I believe to have a time complexity of O(n.m), where n is the length of the deleted key and m is the size of the set of characters used, as for every time we process a node, we need to check if it still has some other connections to other nodes or not, which takes O(m) time. However, almost every source says that it works in O(n) time. Can anyone please explain to me? Thank you for reading, have a nice day!

Теги #trie, #delete

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Francesco4203 2022-06-07 16:36:52 550 Initial revision (published)