What is a time complexity for finding the total length of all string on all edges of a tree?

(a) Ɵ (n)

(b) Ɵ (n!)

(c) Ɵ (1)

(d) O (n^2)

This is a very interesting question from Suffix tree topic in chapter Trie of Data Structures & Algorithms I

The question was posed to me by my college professor while I was bunking the class.

1 Answers