Binary search tree issues

Apr 18, 2013 at 2:13pm
kjaswdqeeas
Last edited on Apr 19, 2013 at 12:58pm
Apr 18, 2013 at 2:14pm
thanks for not helping. I solved all problems.
Last edited on Apr 19, 2013 at 1:00pm
Apr 18, 2013 at 2:29pm
Could you exactly tell what problems you have ? generally looking for problems in a code is not a good idea.
Apr 18, 2013 at 2:50pm

In file included from driver.cpp:1:
tree.h: In member function `void tree<T>::leafCount() const':
tree.h:51: error: `val' undeclared (first use this function)
tree.h:51: error: (Each undeclared identifier is reported only once for each function it appears in.)

tree.h: In member function `int tree<T>::calculateHeightHelper(treeNode<T>*)':

tree.h:189: error: `leftPtr' undeclared (first use this function)
tree.h:190: error: `rightPtr' undeclared (first use this function)
tree.h: In member function `void tree<T>::search()':
tree.h:217: error: `data' undeclared (first use this function)

tree.h: In member function `void tree<T>::search() [with T = int]':
driver.cpp:78:   instantiated from here
tree.h:217: error: return-statement with a value, in function returning 'void'
tree.h: In member function `int tree<T>::calculateHeight() [with T = int]':
driver.cpp:83:   instantiated from here
tree.h:175: error: no matching function for call to `tree<int>::calculateHeight(treeNode<int>*&)'
tree.h:173: note: candidates are: int tree<T>::calculateHeight() [with T = int]


Are the errors i get when i run it. Which is why i mentioned that i think my problems lie within the function headers. Sorry for editing what i already posted i copied the code from the wrong file.
Last edited on Apr 18, 2013 at 3:11pm
Apr 18, 2013 at 3:52pm
Can anyone offer any solution to my problems
Apr 18, 2013 at 6:10pm
Don't be impatient. People here are quite helpful and quick.


line 51
val is not declared.

189, 190 - variables are not declared.
217 - function has void return type, it should not return a value.


I wonder, if you are working with templates and not able to fix these simple issues ?
Apr 20, 2013 at 6:07pm
thanks for not helping. I solved all problems.


we are not paid here to fix your issues... try to help yourself rather than being arrogant.
Topic archived. No new replies allowed.