1.

What is the time complexity for maintaining a dynamic set of weighted trees?(a) O (n)(b) O (n^2)(c) O (log n)(d) O (n!)This is a very interesting question from Binary Trees in section Binary Trees of Data Structures & Algorithms II have been asked this question at a job interview.

Answer»

The correct option is (C) O (log n)

The best I can EXPLAIN: A LOT of applications have been implemented using Top TREE interface. Maintaining a dynamic set of weighted trees is one such application which can be implemented with O (log n) time complexity.



Discussion

No Comment Found

Related InterviewSolutions