NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
▲Treap (Cartesian Tree) (cp-algorithms.com)
rbehrends 24 minutes ago [-]
The primary attraction of treaps (aside from fast intersection/union/diff) is that they are probably one of the easiest types of balanced trees that can be implemented manually if you need a dependency-free balanced tree. There are only two types of rotations, they are straightforward, and they are mirror images of each other.

These days, where an agent can just write you an AVL tree, red-black tree, or B-tree library in under a minute, it probably matters less.

sparkilyshpark 2 hours ago [-]
this is non-rotation treap (fhq treap), it is more common among competitive programming folks, for other cs folks, i believe the rotating variant is more popular: https://www.cs.umd.edu/class/spring2022/cmsc420-0101/Lects/l...
vismit2000 4 hours ago [-]
4 hours ago [-]
Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 09:56:47 GMT+0000 (Coordinated Universal Time) with Vercel.