func (n *Treap[T]) Diff(other *Treap[T], c CompareFn[T]) *Treap[T] {
	if n == nil || other == nil {
		return n
	}

	// TODO -- use  count
	if n.Priority >= other.Priority {
		left, dupe, right := other.Split(n.Value, c)
		left, right = n.Left.Diff(left, c), n.Right.Diff(right, c)
		if dupe != nil {
			return left.join(right)
		}
		return &Treap[T]{n.Value, n.Priority, left, right}
	}

	left, _, right := n.Split(other.Value, c)
	left = left.Diff(other.Left, c)
	right = right.Diff(other.Right, c)
	return left.join(right)
}
// Diff finds all elements of current treap which aren't present in
// the other heap
Diff finds all elements of current treap which aren't present in
the other heap
// Diff finds all elements of current treap which aren ' t present in // the other heap
func (n *Treap[T]) Diff(other *Treap[T], c CompareFn[T]) *Treap[T] {
	if n == nil || other == nil {
		return n
	}
	if n.Priority >= other.Priority {
		left, dupe, right := other.Split(n.Value, c)
		left, right = n.Left.Diff(left, c), n.Right.Diff(right, c)
		if dupe != nil {
			return left.join(right)
		}
		return &Treap[T]{n.Value, n.Priority, left, right}
	}
	left, _, right := n.Split(other.Value, c)
	left = left.Diff(other.Left, c)
	right = right.Diff(other.Right, c)
	return left.join(right)
}
func ( n * Treap [ T ] ) Diff ( other * Treap [ T ] , c CompareFn [ T ] ) * Treap [ T ] { if n == nil || other == nil { return n } if n . Priority >= other . Priority { left , dupe , right := other . Split ( n . Value , c ) left , right = n . Left . Diff ( left , c ) , n . Right . Diff ( right , c ) if dupe != nil { return left . join ( right ) } return & Treap [ T ] { n . Value , n . Priority , left , right } } left , _ , right := n . Split ( other . Value , c ) left = left . Diff ( other . Left , c ) right = right . Diff ( other . Right , c ) return left . join ( right ) }
Diff finds all elements of current treap which aren't present in
the other heap
Diff finds all elements of current treap which aren ' t present in the other heap
// TODO -- use  count