I am trying to complete an assignment for a school, and I do not know how to handle this. I have provided the link below for the context of the assignment:
https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B1DkmkmuB-leNDVmMDU0MDgtYmQzNC00OTdkLTgxMDEtZTkxZWQyYjM4OTI1&hl=en
I have a general idea of โโhow to do everything that assigns the task, but I'm not sure how to handle the input.
Input Example:
a0
0
a00
ab000
Which gives the result:
Tree 1:
Invalid!
Tree 2:
height: -1
path length: 0
completed: yes postorder:
Tree 3:
height: 0
path length: 0
completed: yes postorder: a
Tree 4:
height: 1
path length: 1
completed: yes postorder: ba
I intend to do this using Java. My question is, how can I enter several lines of input, as in the example, in the cmd.exe line of Windows, if they are not connected in the input file? Because pressing enter just launches the program with one line of input instead of creating a new line. Also, since the assignment is assigned automatically, the input cannot be interactive, so how do I know when to stop reading?
Thanks.
source share