From 21fbc24e0240471301460c066a0ffb7dbe976ed7 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 27 Jul 2024 18:31:24 +0100 Subject: [PATCH] posts: add 'treap-revisited' --- .../posts/2024-07-27-treap-revisited/index.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 content/posts/2024-07-27-treap-revisited/index.md diff --git a/content/posts/2024-07-27-treap-revisited/index.md b/content/posts/2024-07-27-treap-revisited/index.md new file mode 100644 index 0000000..c9c01bc --- /dev/null +++ b/content/posts/2024-07-27-treap-revisited/index.md @@ -0,0 +1,29 @@ +--- +title: "Treap, revisited" +date: 2024-07-27T14:12:27+01:00 +draft: false # I don't care for draft mode, git has branches for that +description: "An even simpler BST" +tags: + - algorithms + - data structures + - python +categories: + - programming +series: + - Cool algorithms +favorite: false +disable_feed: false +--- + +My [last post]({{< relref "../2024-07-20-treap/index.md" >}}) about the _Treap_ +showed an implementation using tree rotations, as is commonly done with [AVL +Trees][avl] and [Red Black Trees][rb]. + +But the _Treap_ lends itself well to a simple and elegant implementation with no +tree rotations. This makes it especially easy to implement the removal of a key, +rather than the fiddly process of deletion using tree rotations. + +[avl]: https://en.wikipedia.org/wiki/AVL_tree +[rb]: https://en.wikipedia.org/wiki/Red%E2%80%93black_tree + +