bool fun1() {if (root) return doFun1(root); else return false;}

bool doFun1(Node *ptr){
		if(ptr->left)	doFun1(ptr->left);
		if(ptr->right)	doFun1(ptr->right);
		if(ptr->left)	doFun1(ptr->left);
		ptr->data=ptr->data*7;
		if (ptr->data>500) cout<<.5*ptr->data<<endl;
		else if (ptr->data<50) cout<<5*ptr->data<<endl;
		return true;}

int main( ) {
	Tree t;
	t.insert(14);t.insert(13);t.insert(31);t.insert(27);t.insert(12);
	t.fun1();
	return 0;}

I am trying to trace through this and the output is giving:
294 \\<12*7*7*0.5
661.5 \\<27*7*7*0.5
2058
14406
318.5
i understand where the first two come from (see beside them) i just can't figure out the later 3 any help helping me see the recursion would be greatly appreciated

your coding style is terrible. Don't be afraid to use more white space -- it won't slow down the compile time any and won't take up any more room on your hard drive.

your coding style is terrible. Don't be afraid to use more white space -- it won't slow down the compile time any and won't take up any more room on your hard drive.

Seconded. :P

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.