implement `node_count`, `maximum`, and `depth` with fold