Are treaps slow ?

Правка en1, от svg_af, 2016-02-19 21:39:50

Hello there

so I'm trying to solve this problem

It's about finding the gcd of a set of numbers where i insert and delete numbers from the set

I already solved it with a segment tree, and after learning about treas i tried solving it with a treap but it TLEd on testcase 18

now my question is: aren't treaps on average Log(n)? if so ... shouldn't it pass where segment tree did with complexity of stable Log(n)?

here's my treap code for reference for maybe the error is in my implementation

Теги treap, tle, complexity

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский svg_af 2016-02-19 21:39:50 608 Initial revision (published)