pub const Node = struct 49
50
51
52
53
54
55
56
57
58
59
60
61 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);
}
}
A Node represents an item or point in the treap with a uniquely associated key.