A Node represents an item or point in the treap with a uniquely associated key.
node: *Nodepub fn next(node: *Node) ?*Node {
return nextOnDirection(node, 1);
}pub const Node = struct {
key: Key,
priority: usize,
parent: ?*Node,
children: [2]?*Node,
pub fn next(node: *Node) ?*Node {
return nextOnDirection(node, 1);
}
pub fn prev(node: *Node) ?*Node {
return nextOnDirection(node, 0);
}
}