-fprintf(f, "%c%c %s\n",
- (p->left == NULL)? 'N':'Y', (p->right == NULL)? 'N':'Y', p->name);
-if (p->left != NULL) write_tree(p->left, f);
-if (p->right != NULL) write_tree(p->right, f);
+fprintf(f, "%c%c %s\n", p->left ? 'Y':'N', p->right ? 'Y':'N', p->name);
+if (p->left) write_tree(p->left, f);
+if (p->right) write_tree(p->right, f);