David 4 лет назад
Родитель
Сommit
a60a180445
1 измененных файлов: 10 добавлений и 2 удалений
  1. +10
    -2
      src/ChainQueue.java

+ 10
- 2
src/ChainQueue.java Просмотреть файл

@@ -33,7 +33,7 @@ public class ChainQueue<E> implements Queue<E> {

}

Node<E> node;
Node<E> node; // first item

@Override
public boolean add(E input) { // Übergeben der "Data"
@@ -144,7 +144,12 @@ public class ChainQueue<E> implements Queue<E> {

@Override
public E poll() {
return null;
E temp = null;
if (!this.isEmpty()) {
temp = node.getData();
node = node.getNext();
}
return temp;
}

@Override
@@ -154,6 +159,9 @@ public class ChainQueue<E> implements Queue<E> {

@Override
public E peek() {
if (!this.isEmpty()) {
return node.getData();
}
return null;
}


Загрузка…
Отмена
Сохранить