template of valid binsary search tree