Machine-translated by Google. Questions are authored in English.
Top

Discussion

A binary search tree implementation of a symbol table gives average lookup cost

  • A.linear in the number of entries in every case
  • B.quadratic in the number of entries in the table
  • C.logarithmic in the number of entries
  • D.constant regardless of the number of entries

Answer: C

Correct answer: logarithmic in the number of entries

A balanced tree halves the search space at each step, giving \( O(\log n) \) lookup, and it keeps the entries in order - useful for producing a sorted listing. A hash table is faster still, at constant average cost, but loses the ordering.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.