Compare commits

...

1 Commits

Author SHA1 Message Date
Tim
72de362126 Cleaned contentType 2020-09-10 11:05:59 +02:00
2 changed files with 4 additions and 4 deletions

View File

@@ -10,10 +10,10 @@ public class Queue<ContentType> {
public void enqueue( ContentType pContentObject ) { public void enqueue( ContentType pContentObject ) {
if (head == null) { if (head == null) {
head = new QueueNode<ContentType>(pContentObject); head = new QueueNode<>(pContentObject);
tail = head; tail = head;
} else { } else {
QueueNode<ContentType> node = new QueueNode<ContentType>(pContentObject); QueueNode<ContentType> node = new QueueNode<>(pContentObject);
tail.setNext(node); tail.setNext(node);
tail = node; tail = node;
} }

View File

@@ -9,11 +9,11 @@ public class Stack<ContentType> {
public void push( ContentType pContentObject ) { public void push( ContentType pContentObject ) {
if (head != null) { if (head != null) {
StackNode<ContentType> node = new StackNode<ContentType>(pContentObject); StackNode<ContentType> node = new StackNode<>(pContentObject);
node.setNext(head); node.setNext(head);
head = node; head = node;
} else { } else {
head = new StackNode<ContentType>(pContentObject); head = new StackNode<>(pContentObject);
} }
} }