172
правки
Изменения
→Псевдокод
'''Treap''' merge(t1: '''Treap''', t2: '''Treap'''):
'''if''' t1 t2 == <tex> \varnothing </tex> '''return'''t1 'or''if' t2 '' t1 == <tex> \varnothing </tex> '''return''' t2 == <tex> \varnothing </tex> ? t1 : t2
'''else if''' t1.y > t2.y
t1.right = merge(t1.right, t2)