Results 1 to 7 of 7

Thread: binary tree q

  1. #1
    stuckonjava is offline Senior Member
    Join Date
    Jan 2012
    Posts
    151
    Rep Power
    3

    Default binary tree q

    The objects of the following class BinaryTreeNode are intended to be linked together, through pointers leftChild and rightChild, to form binary trees.
    public class BinaryTreeNode {
    Object element;
    BinaryTreeNode leftChild;
    BinaryTreeNode rightChild;
    // constructors ...
    }

    Give the code for a recursive method visitAll(t) which applies a method visit(BinaryTreeNode x) to each node x in the tree rooted at t, consid- ering the nodes in the post-order. To write your code, assume that the method visitAll has access to the data members of the objects of class BinaryTreeNode.

    public static void visitAll( BinaryTreeNode t ) { ... // YOUR CODE REPLACES DOTS HERE
    }


    can anyone help please, thanks

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: binary tree q

    Forum Rules
    Guide For New Members
    BB Code List - Java Programming Forum

    can anyone help please, thanks
    You've been here long enough to know that's not how a forum works. You need to ask a specific question, not imply that you want someone to do your homework for you.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,779
    Rep Power
    7

    Default Re: binary tree q

    Your post makes it seem like you want us to write the code for us. That isn't what you want is it? Because that would be cheating.

  4. #4
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default Re: binary tree q

    GUYS! QUCIK! Move out of the way of that falling homework-dump!

  5. #5
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,431
    Blog Entries
    7
    Rep Power
    20

    Default Re: binary tree q

    Quote Originally Posted by quad64bit View Post
    GUYS! QUCIK! Move out of the way of that falling homework-dump!
    I don't know what 'qucik' means, but I take it it's an expression of despair; as in 'qucik! the hippopotamus fell in the whipped cream!". I think I'm going to use it in daily speech ...

    kind quciks,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default Re: binary tree q

    That was the sound I made while being pummeled with homework dumps.

  7. #7
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,431
    Blog Entries
    7
    Rep Power
    20

    Default Re: binary tree q

    Quote Originally Posted by quad64bit View Post
    That was the sound I made while being pummeled with homework dumps.
    qucik! Where are the rotating knives!

    kind regards,

    Jos ;-)
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Binary tree
    By harmy in forum New To Java
    Replies: 1
    Last Post: 02-03-2012, 08:46 AM
  2. Binary Tree Help - Find the largest sub-tree
    By joshhazel in forum New To Java
    Replies: 2
    Last Post: 01-30-2012, 02:08 AM
  3. Replies: 0
    Last Post: 04-04-2010, 07:40 AM
  4. Binary Tree
    By MuslimCoder in forum New To Java
    Replies: 8
    Last Post: 11-19-2009, 05:57 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •