+1 vote
in Data Structures & Algorithms I by (110k points)
What is the average running time of a treap?

(a) O(N)

(b) O(N log N)

(c) O(log N)

(d) O(M log N)

This intriguing question comes from Binary Trees topic in chapter Binary Trees of Data Structures & Algorithms I

This question was addressed to me in a national level competition.

1 Answer

+1 vote
by (672k points)
selected by
Best answer
Right answer is (c) O(log N)

For explanation: The average case and worst case analysis of a treap are mathematically found to be O(log N).

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.