Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void scoreTree(Node curr){
- int nodeChoice = 0;
- Node temp = curr;
- if(temp.getChildren()!= null){
- for(int i = 0; i < temp.getChildren().size(); i++){
- // System.out.println("loop");
- if((temp.getChildren().get(i).isLeaf())){
- if(temp.getChildren().get(i).getScore() == 1){
- temp.setScore(1);
- temp.getChildren().get(i).setScore(0);
- System.out.println(temp.getChildren().get(i).getValue());
- }
- else{
- temp.setScore(-1);
- temp.getChildren().get(i).setScore(0);
- }
- }
- scoreTree(temp.getChildren().get(i));
- }
- }
- temp.setScore(1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement