Final answer:
The lowest common ancestor of a Binary Search Tree (BST) is the deepest node that is an ancestor of two given nodes.
Step-by-step explanation:
The lowest common ancestor (LCA) of a Binary Search Tree (BST) is the shared ancestor of two nodes that is located farthest from the root. In other words, it is the deepest node that is an ancestor of both given nodes.
To find the LCA, we can start from the root node and traverse down the BST. If both nodes are less than the current node, we move to the left subtree. If both nodes are greater than the current node, we move to the right subtree. If neither of these conditions are met, it means we have found the LCA.
For example, consider a BST with nodes labeled from 1 to 9. The LCA of nodes 5 and 8 would be node 7, as it is the deepest node that is an ancestor of both nodes.