Compare commits

..

7 commits

Author SHA1 Message Date
Bruno BELANYI 40dd12c50a posts: gap-buffer: fix typo
All checks were successful
ci/woodpecker/push/deploy/2 Pipeline was successful
2024-07-20 19:28:16 +01:00
Bruno BELANYI 8f91d00418 posts: union-find: fix typo 2024-07-20 19:28:16 +01:00
Bruno BELANYI 9f39a62771 Add Treap post 2024-07-20 19:28:16 +01:00
Bruno BELANYI 08959bacfa posts: treap: add insertion 2024-07-20 19:28:16 +01:00
Bruno BELANYI 782d4c94c6 posts: treap: add search 2024-07-20 19:28:16 +01:00
Bruno BELANYI 7eb96b11ea posts: treap: add construction 2024-07-20 19:28:16 +01:00
Bruno BELANYI dec1e79b5c posts: treap: add presentation 2024-07-20 19:28:16 +01:00

View file

@ -31,7 +31,7 @@ parent's priority is always higher than any of its children.
## What does it do?
By randomizing the priority value of each key at insertion time, we ensure a
high likelihood that the tree stays _roughly_ balanced, avoiding degenerating to
high likelihook that the tree stays _roughly_ balanced, avoiding degenerating to
unbalanced O(N) height.
Here's a sample tree created by inserting integers from 0 to 250 into the tree:
@ -41,8 +41,8 @@ Here's a sample tree created by inserting integers from 0 to 250 into the tree:
## Implementation
I'll be keeping the theme for this [series] by using Python to implement the
_Treap_. This leads to somewhat annoying code to handle the rotation process,
which is easier to do in C using pointers.
_Treap_. This leads to somewhat annoying code to handle the `left`/`right` nodes
which is easier to do in C, using pointers.
[series]: {{< ref "/series/cool-algorithms/" >}}