172
правки
Изменения
→Псевдокод
'''<tex>\langle</tex>Treap, Treap<tex>\rangle</tex>''' split(t: '''Treap''', k: '''int'''):
'''if''' t == <tex> \varnothing </tex>
'''return''' <tex>\langle</tex><tex> \varnothing </tex>, <tex> \varnothing </tex><tex>\rangle</tex>
'''else if''' k > t.x
<tex>\langle</tex>t1, t2<tex>\rangle</tex> = split(t.right, k)
t.right = t1
'''return''' <tex>\langle</tex>t1, t2<tex>\rangle</tex>
'''else'''
<tex>\langle</tex>t1, t2<tex>\rangle</tex> = split(t.left, k)
t.left = t2
'''return''' <tex>\langle</tex>t1, t2<tex>\rangle</tex>
=== Время работы ===