Compare commits

..

7 commits

Author SHA1 Message Date
Bruno BELANYI a868474177 posts: gap-buffer: fix typo
Some checks failed
ci/woodpecker/push/deploy/2 Pipeline was successful
ci/woodpecker/cron/deploy/2 Pipeline failed
2024-07-20 19:29:59 +01:00
Bruno BELANYI 9728aa537e posts: union-find: fix typo 2024-07-20 19:29:59 +01:00
Bruno BELANYI 4c12ebb16c Add Treap post 2024-07-20 19:29:59 +01:00
Bruno BELANYI ca89605db5 posts: treap: add insertion 2024-07-20 19:29:59 +01:00
Bruno BELANYI 1539ed5ce9 posts: treap: add search 2024-07-20 19:29:59 +01:00
Bruno BELANYI f981ee9903 posts: treap: add construction 2024-07-20 19:29:59 +01:00
Bruno BELANYI a4b02f3644 posts: treap: add presentation 2024-07-20 19:29:59 +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 likelihook that the tree stays _roughly_ balanced, avoiding degenerating to
high likelihood 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 `left`/`right` nodes
which is easier to do in C, using pointers.
_Treap_. This leads to somewhat annoying code to handle the rotation process,
which is easier to do in C using pointers.
[series]: {{< ref "/series/cool-algorithms/" >}}