| | |
Tree java
![]() |
•
•
Join Date: Oct 2009
Posts: 16
Reputation:
Solved Threads: 0
Hello I am trying to read a node that will find the longest word in a tree. So, my method is a public static int word(Node d) So how would I have to find the length of that node? Would I just use the string that was made in the class? Like I don't know how I would read the node. Its in a public class where it has a boolean, String , and children. So, this is what I have.
Java Syntax (Toggle Plain Text)
int newWord = 0; int word = d.wordToHere.length(); if(word > newWord){ newWord = word; return longestWord((Node) d.children); } else{ return longestWord( (Node) d.children); }
Last edited by TigerGirl; 28 Days Ago at 3:21 am. Reason: need to add more details
![]() |
Other Threads in the Java Forum
- Previous Thread: can I make link on scroll text in a swing java
- Next Thread: Expression Trees
| Thread Tools | Search this Thread |
.net 3d ajax android apple applet applications appportability array automation bidirectional binary bold build byte c++ chat class classes code codesnippet color component coordinates derby design detection development dice ebook eclipse educational error event ext file firefox forms fractal function game glassfish google gui guidancer helpwithhomework html hyper image integer intellijidea8 java javafx javascript jetbrains julia keyword klocwork linux listbox machine macintosh method microsoft mysql netbeans newbie noob object officefileformats oracle php plazmic poi printf problem producer programming python recursion researchinmotion ruby search service set software sort source ssl string sun support swing threads tree ubuntu virtualization web webservices windows






