1.

What will be the time complexity of delete operation if all the candidates are evenly spaced so that each bin has constant no. of candidates? (m = number of bins intersecting candidate intersects)(a) O(1)(b) O(m)(c) O(m^2)(d) O(log m)This interesting question is from Trees topic in chapter Trees of Data Structures & Algorithms II had been asked this question in my homework.

Answer»

Right option is (b) O(m)

The best I can EXPLAIN: The process of DELETION becomes faster in a case when the number of candidates are equally distributed AMONG the bins. In such a case the QUERY operation becomes O(m). It is practically SLOWER than insertion in this case.



Discussion

No Comment Found

Related InterviewSolutions