+1 vote
in Data Structures & Algorithms I by (88.2k points)
What is a time complexity for inserting an alphabet in the tree using hash maps?

(a) O (log n!)

(b) O (n!)

(c) O (n^2)

(d) O (1)

The origin of the question is Suffix tree topic in chapter Trie of Data Structures & Algorithms I

This question was addressed to me during an interview.

1 Answer

+1 vote
by (672k points)
selected by
 
Best answer
The correct choice is (d) O (1)

Best explanation: Suffix tree is also known as PAT tree or position tree. It allows fast string operation. Total time taken for construction of suffix tree is linear to the length of the tree. The time complexity for inserting an alphabet in the tree using hash maps is constant, O (1).

Related questions

Welcome to TalkJarvis QnA, a question-answer community website for the people by the people. On TalkJarvis QnA you can ask your doubts, curiosity, questions and whatever going in your mind either related to studies or others. Experts and people from different fields will answer.

Categories

...