Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Binary Search T...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 45815 of 45898
Post > Topic >>

Binary Search Tree Problems

by pleatofthepants <aaronWbryant@[EMAIL PROTECTED] > May 8, 2008 at 03:20 PM

I have a maxValue function that is called when I am removing a node
from my tree.

template <class T>
T BST<T> :: maxValue (TreeNode<T>* p)
{
	if (p == NULL) throw ("BAD POINTER");

		while (p-> right)
		{
			p = p-> right;
			return *this;
		}
}

I am getting this error when it compiles: cannot convert BST<int> to
'int' in return
How do I fix this?




 2 Posts in Topic:
Binary Search Tree Problems
pleatofthepants <aaron  2008-05-08 15:20:49 
Re: Binary Search Tree Problems
"Alf P. Steinbach&qu  2008-05-09 00:29:15 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 0:40:55 CDT 2008.