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