A function that will take a tree as argument and return the number of ints
that were typed?
I need a function in my project that will take a tree as argument and
return the number of integers that were typed and a correct call.
wouldn't it just be preorder? like below. Please. Thanks
#include "t.h"
void preorder(tnode * t){
if (t == NULL) return;
cout << t->info <<endl;
preorder(t->left);
preorder(t->right);
}
call would be preorder(t).
No comments:
Post a Comment