给定一个二进制树,确定它是否是一个有效的二进制搜索树 (BST).一个BST被定义如下:节点的左子树只包含比节点的键小的节点.节点的右子树只包含比节点的键大的节点.左和右子树都必须是二进制搜索树.例如,如果输入树是 [2,1,3],输出树应该是真实的.如果输入树是 [5,1,4,null,null,3,6],输出树应该是假的.
To determine if a binary tree is a valid binary search tree, you can perform an inorder traversal of the tree and check if the resulting list of nodes is sorted in ascending order. If it is, then the tree is a valid binary search tree; otherwise, it is not. Here is a sample code in Python:

```
class Solution:
    def isValidBST(self, root: TreeNode) -> bool:
        stack, inorder = [], float('-inf')
        while stack or root:
            while root:
                stack.append(root)
                root = root.left
            root = stack.pop()
            if root.val <= inorder:
                return False
            inorder = root.val
            root = root.right
        return True
```
In this code, the `isValidBST` function takes a root node of a binary tree and returns a boolean value indicating whether the tree is a valid binary search tree or not. The function performs an iterative inorder traversal of the tree using a stack. It keeps track of the previous node value in the inorder sequence (`inorder`) and checks if the current node's value is greater than the previous value. If it is not, the function returns False. If the entire traversal is completed without any violation of the ordering rule, the function returns True.