func (n *IntNode) rotateRight() (root *IntNode) {
	root = n.Left
	n.Left = root.Right
	root.Right = n
	root.Color = n.Color
	n.Color = llrb.Red
	if root.Right.Left == nil {
		root.Right.Range.Start = root.Right.Interval.Start
	} else {
		root.Right.Range.Start = root.Right.Left.Range.Start
	}
	root.Right.Range.End = intMaxRange(root.Right, root.Right.Left, root.Right.Right)
	root.Range.End = intMaxRange(root, root.Left, root.Right)
	return
}
(a,c)b -rotR-> (,(,c)b)a
package interval
import (
	"github.com/biogo/store/llrb"
)
type IntOverlapper interface {
	Overlap(IntRange) bool
}
type IntRange struct {
	Start, End int
}
type IntInterface interface {
	IntOverlapper
	Range() IntRange
	ID() uintptr  
}
type IntNode struct {
	Elem        IntInterface
	Interval    IntRange
	Range       IntRange
	Left, Right *IntNode
	Color       llrb.Color
}
type IntTree struct {
	Root  *IntNode  
	Count int       
}
func (n *IntNode) color() llrb.Color {
	if n == nil {
		return llrb.Black
	}
	return n.Color
}
func intMaxRange(root, left, right *IntNode) int {
	end := root.Interval.End
	if left != nil && left.Range.End > end {
		end = left.Range.End
	}
	if right != nil && right.Range.End > end {
		end = right.Range.End
	}
	return end
}
func (n *IntNode) rotateLeft() (root *IntNode) {
	root = n.Right
	n.Right = root.Left
	root.Left = n
	root.Color = n.Color
	n.Color = llrb.Red
	root.Left.Range.End = intMaxRange(root.Left, root.Left.Left, root.Left.Right)
	if root.Left == nil {
		root.Range.Start = root.Interval.Start
	} else {
		root.Range.Start = root.Left.Range.Start
	}
	root.Range.End = intMaxRange(root, root.Left, root.Right)
	return
}