Question discussion

The time taken to search for a word of length L in a trie is

1703Medium DSSSB TGT Computer Science 0 replies 1 views
0

The time taken to search for a word of length L in a trie is

  • AO(n × L), where n is the number of words stored
  • BO(L log n), where n is the number of words stored
  • CO(n), where n is the number of words stored
  • DO(L), independent of the number of words stored
Correct answer: D

Explanation

The search follows one edge per character, so it needs at most L steps whatever the number of stored words.

Discussion 0

Nobody has replied yet. Start the discussion!