What is the average running time of a treap?

Category: QuestionsWhat is the average running time of a treap?
Editor">Editor Staff asked 1 month ago

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 Answers
Editor">Editor Staff answered 1 month ago

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).