MCPcopy Create free account
hub / github.com/denoland/std / findSuccessorNode

Method findSuccessorNode

data_structures/_binary_search_node.ts:51–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 }
50
51 findSuccessorNode(): BinarySearchNode<T> | null {
52 if (this.right !== null) return this.right.findMinNode();
53 let parent: BinarySearchNode<T> | null = this.parent;
54 let direction: Direction | null = this.directionFromParent();
55 while (parent && direction === "right") {
56 direction = parent.directionFromParent();
57 parent = parent.parent;
58 }
59 return parent;
60 }
61}

Callers 2

#removeNodeMethod · 0.80

Calls 2

directionFromParentMethod · 0.95
findMinNodeMethod · 0.80

Tested by

no test coverage detected