Capital One interview question

Write a program to check if a node is the head of a binary search tree