Consider this Python code aiming to check if a Binary Tree is a Binary Search Tree (BST). Does it function correctly?
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def is_bst(root):
if root is None:
return True
if root.left and root.left.data > root.data:
return False
if root.right and root.right.data < root.data:
return False
return is_bst(root.left) and is_bst(root.right)