Binary tree checker