| | |
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; 26 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 addball ajax apple applet applicaions array automation bidirectional binary build businessintelligence buyouts c++ card class code codesnippet component database deploy derby design detection development developmenthelp eclipse educational error firefox forms fractal ftp game glassfish google gui guidancer helpwithhomework html hyper idea image infosec integer java javadesktopapplications javafx javascript jetbrains jni julia keyword klocwork linux listbox loop macintosh main method methods microsoft microsystems mysql netbeans newbie nextline open-source oracle plazmic poi pong problem programming python qanda qt recursion reporting rodjohnson ruby search security service set software sort sql string sun superclass support swing testautomation threads tree web webservices whileloop windows






