use of org.snakeyaml.engine.v2.nodes.Node in project psu172 by basit388.
the class Tester method main.
public static void main(String[] s) {
Node k1 = new Node();
k1.val = 10;
Node k2 = new Node(20);
Node k3 = k2;
System.out.println(k1.val);
System.out.println(k2.val);
System.out.println(k3.val);
}
use of org.snakeyaml.engine.v2.nodes.Node in project psu172 by basit388.
the class Tester3 method main.
public static void main(String[] s) {
Node k1 = new Node(10);
k1.next = new Node(20);
// Temp Node
Node temp = k1;
System.out.println(temp.val);
// moving Temp to next node in the chain
temp = temp.next;
System.out.println(temp.val);
}
use of org.snakeyaml.engine.v2.nodes.Node in project psu172 by basit388.
the class Tester4 method main.
public static void main(String[] s) {
Node k1 = new Node(10);
k1.next = new Node(20);
k1.next.next = new Node(30);
// Temp Node
Node temp = k1;
System.out.println(temp.val);
// moving Temp to next node in the chain
temp = temp.next;
System.out.println(temp.val);
temp = temp.next;
System.out.println(temp.val);
}
use of org.snakeyaml.engine.v2.nodes.Node in project psu172 by basit388.
the class Tester5 method main.
public static void main(String[] s) {
Node k1 = new Node(10);
k1.next = new Node(20);
k1.next.next = new Node(30);
// Temp Node
Node temp = k1;
while (temp != null) {
System.out.println(temp.val);
temp = temp.next;
}
}
use of org.snakeyaml.engine.v2.nodes.Node in project psu172 by basit388.
the class Tester6 method main.
public static void main(String[] s) {
int SIZE = 10;
Node Head = new Node(1);
Node temp = Head;
for (int i = 2; i < SIZE; i++) {
temp.next = new Node(i);
temp = temp.next;
}
// Head points to the first node in the chain
// Its important not to loose the head reference
// Lets see what was created using Head.
// Again work with a temp reference
temp = Head;
while (temp != null) {
System.out.println(temp.val);
temp = temp.next;
}
}
Aggregations