updateMaxEnd updates the maxEnd value of a node based on children.
(node *treeNode)
| 266 | |
| 267 | // updateMaxEnd updates the maxEnd value of a node based on children. |
| 268 | func updateMaxEnd(node *treeNode) { |
| 269 | node.maxEnd = GetEndTime(node.interval) |
| 270 | if node.left != nil && node.left.maxEnd > node.maxEnd { |
| 271 | node.maxEnd = node.left.maxEnd |
| 272 | } |
| 273 | if node.right != nil && node.right.maxEnd > node.maxEnd { |
| 274 | node.maxEnd = node.right.maxEnd |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | // rotateRight performs a right rotation. |
| 279 | func (t *IntervalTree) rotateRight(y *treeNode) *treeNode { |
no test coverage detected