コード例 #1
0
 public ArrayList<Node> CreateListFromBeginToMidle(Node middleNode) {
   ArrayList<Node> firstHalfList = new ArrayList<Node>();
   Node actualNode = middleNode;
   while (actualNode != null) {
     firstHalfList.add(actualNode);
     actualNode = actualNode.getParentFromBeginNode();
   }
   return reverseList(firstHalfList);
 }
コード例 #2
0
 public static ArrayList<Node> CreateListFromMiddleToEnd(Node middleNode) {
   ArrayList<Node> secondHalfList = new ArrayList<Node>();
   Node actualNode = middleNode.getParentFromEndNode();
   while (actualNode != null) {
     secondHalfList.add(actualNode);
     actualNode = actualNode.getParentFromEndNode();
   }
   return secondHalfList;
 }