Yes I have worked through it manually, I have managed to sort it now, thanks very much for your help
Type: Posts; User: sim18
Yes I have worked through it manually, I have managed to sort it now, thanks very much for your help
Does that mean I will have to include the brackets in me code?
Example:
BinaryTreeNode n1 = new BinaryTreeNode("A");
it is just 'to the power of'
1. Traverse left sub tree
2. Traverse right sub tree
3. Visit root
public void postOrder(BinaryTreeNode t)
{
ArrayQueue q = new ArrayQueue();
if (t != null)
{
From the test class I am creating new binaryTreeNodes that make up: (A*B) / (C^D^E), from the Traversal class it will then go through the nodes and output each node onto the screen in the order they...
Sorry, code should work now
This will compile and run the test
public class Testing
{
}
Everything compiles fine and there are no errors.
The only error as I said before is that that output of the PostOrder traversal result is : AB*C/D^E^, but the postOrder should not be like that.
...
I don't understand what you mean sorry?
Sorry to ask another question.
My tree works perfect now printing out, A+B or A-B / C in all four different traversals.
Here is my code:
BinaryTreeNode n1 = new BinaryTreeNode("A");
Thank you :D
It works now, next time I will be sure to read the error message properly
"no suitable constructor found for BinaryTreeNode(java.lang.String,BinaryTreeNode,BinaryTreeNode)
constructor BinaryTreeNode.BinaryTreeNode(BinaryTreeNode,BinaryTreeNode) is not applicable (actual...
I have created a arrayQueue and binaryTreeTraversal class that has different traversal methods, both of these classes work :)
I have got my BinaryTreeNode class
public class BinaryTreeNode
{...