Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: code for finding the maximum in a tree

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default code for finding the maximum in a tree

    //the following code is not running help out

    public Node maximum()
    {
    Node current ;
    Node last;
    current =Root ;
    while(current!=null)
    {
    last=current;
    current=current.rightChild;
    }
    return last;
    }


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,332
    My Mood
    Hungover
    Thanks
    143
    Thanked 624 Times in 535 Posts

    Default Re: code for finding the maximum in a tree

    How can it run, I don't see a main() method?

    If you want help, you'll have to ask a specific technical question (saying "it doesn't run" doesn't tell us anything) along with an SSCCE. Don't forget the highlight tags.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Replies: 3
    Last Post: August 26th, 2013, 04:41 PM
  2. Finding and printing maximum value in 2D array..right section? :\
    By new2.java in forum What's Wrong With My Code?
    Replies: 0
    Last Post: February 6th, 2013, 03:56 PM
  3. need help finding code in javadoc
    By lf2killer in forum Java Theory & Questions
    Replies: 3
    Last Post: October 13th, 2012, 08:52 AM
  4. [SOLVED] Finding deepest node of tree??
    By bczm8703 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: April 10th, 2011, 11:48 AM
  5. Need Help - Factoring & Prime Finding Code
    By prodigytoast in forum Algorithms & Recursion
    Replies: 5
    Last Post: November 5th, 2009, 06:38 AM