CS140 -- Final Exam: Question 24 (4 points)

Print out a postorder traversal of the following tree.


Question 25 (8 points)

Here is the typedef for a binary search tree:
typedef struct bstreenode {
  char *key;
  Jval val;
  struct bstreenode *left;
  struct bstreenode *right;
} BstreeNode;
Write a function nnodes, which returns the number of nodes of a binary search tree. The prototype is:
int nnodes(BstreeNode *b);
Note -- this is a pointer to the root of the tree (NULL if the tree is empty).