sonic-forest
Version:
High-performance (binary) tree and sorted map implementation (AVL, Splay, Radix, Red-Black)
17 lines (16 loc) • 363 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.next = void 0;
const first_1 = require("./first");
const next = (curr) => {
const r = curr.r;
if (r)
return (0, first_1.first)(r);
let p = curr.p;
while (p && p.r === curr) {
curr = p;
p = p.p;
}
return p;
};
exports.next = next;