Content-Length: 1156 | pFad | http://github.com/cp-algorithms/cp-algorithms/pull/1477.diff

thub.com diff --git a/src/data_structures/treap.md b/src/data_structures/treap.md index 05eeb4bca..11ff00482 100644 --- a/src/data_structures/treap.md +++ b/src/data_structures/treap.md @@ -92,7 +92,7 @@ Alternatively, insert can be done by splitting the initial treap on $X$ and doin -Implementation of **Erase ($X$)** is also clear. First we descend in the tree (as in a regular binary search tree by $X$), looking for the element we want to delete. Once the node is found, we call **Merge** on it children and put the return value of the operation in the place of the element we're deleting. +Implementation of **Erase ($X$)** is also clear. First we descend in the tree (as in a regular binary search tree by $X$), looking for the element we want to delete. Once the node is found, we call **Merge** on its children and put the return value of the operation in the place of the element we're deleting. Alternatively, we can factor out the subtree holding $X$ with $2$ split operations and merge the remaining treaps (see the picture).








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/cp-algorithms/cp-algorithms/pull/1477.diff

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy