Search:

Type: Posts; User: sim18

Search: Search took 0.10 seconds.

  1. Replies
    23
    Views
    1,428

    Re: Help with this binary tree

    Yes I have worked through it manually, I have managed to sort it now, thanks very much for your help
  2. Replies
    23
    Views
    1,428

    Re: Help with this binary tree

    Does that mean I will have to include the brackets in me code?

    Example:


    BinaryTreeNode n1 = new BinaryTreeNode("A");
  3. Replies
    23
    Views
    1,428

    Re: Help with this binary tree

    it is just 'to the power of'
  4. Replies
    23
    Views
    1,428

    Re: Help with this binary tree

    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)
    {
  5. Replies
    23
    Views
    1,428

    Re: Help with this binary tree

    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...
  6. Replies
    23
    Views
    1,428

    Re: Help with this binary tree

    Sorry, code should work now
  7. Replies
    23
    Views
    1,428

    Re: Help with this binary tree

    This will compile and run the test


    public class Testing
    {

    }
  8. Replies
    23
    Views
    1,428

    Re: Help with this binary tree

    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.
    ...
  9. Replies
    23
    Views
    1,428

    Re: Help with this binary tree

    I don't understand what you mean sorry?
  10. Replies
    23
    Views
    1,428

    Re: Help with this binary tree

    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");
  11. Replies
    23
    Views
    1,428

    Re: Help with this binary tree

    Thank you :D
    It works now, next time I will be sure to read the error message properly
  12. Replies
    23
    Views
    1,428

    Re: Help with this binary tree

    "no suitable constructor found for BinaryTreeNode(java.lang.String,BinaryTreeNode,BinaryTreeNode)

    constructor BinaryTreeNode.BinaryTreeNode(BinaryTreeNode,BinaryTreeNode) is not applicable (actual...
  13. Replies
    23
    Views
    1,428

    Help with this binary tree

    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
    {...
Results 1 to 13 of 13