SORRY I TRIED TO INDENT THE CODE BUT IT DIDNT WORK OUT
I am trying to make a binary tree for conversion of postfix to infix. the binary trees class is as follows
WHAT I HAVE TO DO AND WHAT I AN HAVING TROUBLE WITH
1) READ A POSTFIX EXPRESSION FROM A FILE AND MAKE A TREE. I HAVE TO DO THAT BY THE STACK METHOD.
Here is my binary tree class and questions i have:
1) my destructor and destroy() are still giving problems..
2)inorder and everything else works but for some cases they do not. i think they are the destructor dependent though. they seem to be working when i don't use the destructor and the destroy function. example: something like this always works when i comment out the destructor and destroy..
binaryTree<char> a('a');
binaryTree<char> b('b');
binaryTree<char> c('+',a,b);
binaryTree<char> d('+',b,c);
binaryTree<char> e('*',a,d);
binaryTree<char> f('z',final,d);
f.inOrder();
but when i destroy a tree object and use it later in order seems to give problems.
3)my final question and most important.. how do i store the popped tree in another tree object. for example :
stack<binaryTree> s; // consider the stack has some objects
binaryTree tree;
tree=s.pop() gives a malloc error and run time error.