Hello!
There is a bag in your Merge() func, treap.go, line 197:
- result.left = t.Merge(x, left)
- result.left = t.Merge(left, x)
You forgot to switch arguments places. Your implementation tried to merge the "right.left with left" instead of "left with right.left".