I've been given an assignment to create a recursive algorithm that takes only a pointer r to the root of a binary tree and checks if the tree is a binary search tree. I don't actually need to make the tree, just this function.

The function call should look like this:

bool check(Node * r);

and the included struct is:

struct Node { int key; Node * left; Node * right; };

I simply don't know how to go about doing this. Any hints would be much appreciated.