stack.go
func (s *SegmentStack) Peek() int64 {
	if s.Len() == 0 {
		return rootSegment
	}
	return s.s[s.Len()-1]
}
func (s *SegmentStack) Peek() int64 {
	if s.Len() == 0 {
		return rootSegment
	}
	return s.s[s.Len()-1]
}
// Peek returns id from the top of the stack. It returns rootSegment if the stack is empty.