| | |
How to traverse
![]() |
•
•
Join Date: Oct 2008
Posts: 37
Reputation:
Solved Threads: 0
Java Syntax (Toggle Plain Text)
public String preOrder(int nodeIndex) { if(nodeIndex>nodeArray.length) { return(null); } else if(nodeArray[nodeIndex].isLeaf(nodeArray.length-1)) { return(nodeArray[nodeIndex].toString()); } else { return(nodeArray[nodeIndex].toString()+" "+preOrder(nodeArray[nodeIndex].leftChild)+" "+preOrder(nodeArray[nodeIndex].rightChild)); }
I am really stack with it. I dont how to output the numbers i input. If i input: 1 2 3 4 5 6, it only outputs 1 2 3. Please help me, I really need your help. Thank you in advance. We have to use arrays.
}
![]() |
Similar Threads
- Need to traverse and update a XML file (C++)
- Text file traverse problem (C++)
- How do I traverse tabbedpanes programmatically? (Java)
- traverse function doubly linked list (C)
- How to traverse an array?? What am I doing wrong? (C++)
- Tab control on hidden input fields (HTML and CSS)
Other Threads in the Java Forum
- Previous Thread: Java question...
- Next Thread: JAVA SQL matrix
| Thread Tools | Search this Thread |
3d 6 @param affinetransform android api applet application arc array arrays automation binary bluetooth bold byte c++ chat class client code color compare component coordinates database detection doctype eclipse educational error file fractal froglogic game givemetehcodez graphics gui guitesting helpwithhomework html ide ideas image ingres input integer internet intersect j2me java java.xls javaexcel javaprojects jni jpanel jtextarea julia keytool keyword linux list loop map method methods mobile netbeans newbie nextline object pong print problem producer program programming project projectideas read recursion recursive replaysolutions rim scanner sell server set size sms sort sql string swing terminal threads tree web websites windows





