Capital One Interview Question

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