Treap data structure combining properties of a Binary Search Tree and a Max Heap. Each node satisfies both the BST property (left < root < right) and the heap property based on priority.
The type of values stored in the Treap.
Creates a new Treap.
Optional
Optional comparison function for custom types.
Deletes a value from the Treap.
The value to delete.
Performs an in-order traversal of the Treap for testing or debugging purposes.
The starting node (default is root).
Accumulator for traversal result.
Inserts a value into the Treap with a specified priority.
The value to insert.
The priority of the value.
Searches for a value in the Treap.
The value to search for.
Treap data structure combining properties of a Binary Search Tree and a Max Heap. Each node satisfies both the BST property (left < root < right) and the heap property based on priority.