func (t *tree) Clear() {
	if t.r == nil {
		return
	}
	clr(t.r)
	t.c, t.first, t.last, t.r = 0, nil, nil, nil
	t.ver++
}
Clear removes all K/V pairs from the tree.
package ql
import (
	"io"
)
const (
	kx = 128  
	kd = 64   
)
type (
	cmp func(a, b []interface{}) int
	d struct {  
		c int
		d [2*kd + 1]de
		n *d
		p *d
	}
	de struct {  
		k []interface{}
		v []interface{}
	}
	enumerator struct {
		err error
		hit bool
		i   int
		k   []interface{}
		q   *d
		t   *tree
		ver int64
	}
	tree struct {
		c     int
		cmp   cmp
		first *d
		last  *d
		r     interface{}
		ver   int64
	}
	xe struct {  
		ch  interface{}
		sep *d
	}
	x struct {  
		c int
		x [2*kx + 2]xe
	}
)
var (  
	zd  d
	zde de
	zx  x
	zxe xe
)
func clr(q interface{}) {
	switch z := q.(type) {
	case *x:
		for i := 0; i <= z.c; i++ {  
			clr(z.x[i].ch)
		}
		*z = zx  
	case *d:
		*z = zd  
	}
}
func newX(ch0 interface{}) *x {
	r := &x{}
	r.x[0].ch = ch0
	return r
}
func (q *x) extract(i int) {
	q.c--
	if i < q.c {
		copy(q.x[i:], q.x[i+1:q.c+1])
		q.x[q.c].ch = q.x[q.c+1].ch
		q.x[q.c].sep = nil  
		q.x[q.c+1] = zxe    
	}
}
func (q *x) insert(i int, d *d, ch interface{}) *x {
	c := q.c
	if i < c {
		q.x[c+1].ch = q.x[c].ch
		copy(q.x[i+2:], q.x[i+1:c])
		q.x[i+1].sep = q.x[i].sep
	}
	c++
	q.c = c
	q.x[i].sep = d
	q.x[i+1].ch = ch
	return q
}
func (q *x) siblings(i int) (l, r *d) {
	if i >= 0 {
		if i > 0 {
			l = q.x[i-1].ch.(*d)
		}
		if i < q.c {
			r = q.x[i+1].ch.(*d)
		}
	}
	return
}
func (l *d) mvL(r *d, c int) {
	copy(l.d[l.c:], r.d[:c])
	copy(r.d[:], r.d[c:r.c])
	l.c += c
	r.c -= c
}
func (l *d) mvR(r *d, c int) {
	copy(r.d[c:], r.d[:r.c])
	copy(r.d[:c], l.d[l.c-c:])
	r.c += c
	l.c -= c
}
func treeNew(cmp cmp) *tree {
	return &tree{cmp: cmp}
}