>>515
/* �@ */
void ReverseTree(struct BTREE *ptr)
{
  struct BTREE *tmp;
  if (ptr == NULL) return;
  tmp = ptr->left; ptr->left = ptr->right; ptr->right = tmp;
  ReverseTree(ptr->left);
  ReverseTree(ptr->right);
}

/* �A (ごく一般的なバージョン) */
int ExistTest(struct BTREE *ptr, int searchdata)
{
  if (ptr == NULL) return 0;
  if (searchdata == ptr->data) return 1;
  if (searchdata < ptr->data) return ExistTest(ptr->left, searchdata);
  return ExistTest(ptr->right, searchdata);
}

/* �A (�@が使用されるとツリーが逆順になるので、それも考慮したバージョン) */
int ExistTest(struct BTREE *ptr, int searchdata)
{
  if (ptr == NULL) return 0;
  if (searchdata == ptr->data) return 1;
  if (ExistTest(ptr->left, searchdata)) return 1;
  return ExistTest(ptr->right, searchdata);
}