소스 검색

removed unnecessary lines and added header

master
David 4 년 전
부모
커밋
57d3c08518
2개의 변경된 파일12개의 추가작업 그리고 8개의 파일을 삭제
  1. +6
    -6
      src/ChainQueue.java
  2. +6
    -2
      src/HUE_06_Generics.java

+ 6
- 6
src/ChainQueue.java 파일 보기

@@ -1,12 +1,15 @@
/************************************************
* Name: David Wurm
* Datum: 25.11.2019
* Klasse: 3AHIF
* Programm: HUE_06_GenericsQueue
************************************************/
import java.util.Collection;
import java.util.Iterator;
import java.util.Queue;


public class ChainQueue<E> implements Queue<E> {

private class Node<E> {

private E data;
private Node<E> next;

@@ -30,7 +33,6 @@ public class ChainQueue<E> implements Queue<E> {
this.data = data;

}

}

Node<E> first; // first item of the queue
@@ -42,7 +44,6 @@ public class ChainQueue<E> implements Queue<E> {
return true;
}
return addNode(input, first); // no? -> goto addNode()

}

private boolean addNode(E input, Node n) { // run through the queue and find the first "place" which is empty
@@ -51,7 +52,6 @@ public class ChainQueue<E> implements Queue<E> {
return true;
}
return addNode(input, n.getNext());

}

@Override


+ 6
- 2
src/HUE_06_Generics.java 파일 보기

@@ -1,5 +1,10 @@
/************************************************
* Name: David Wurm
* Datum: 25.11.2019
* Klasse: 3AHIF
* Programm: HUE_06_GenericsQueue
************************************************/
import java.util.Queue;

public class HUE_06_Generics {
public static void main(String[] args) {
Queue<String> strs = new ChainQueue<String>();
@@ -14,6 +19,5 @@ public class HUE_06_Generics {
System.out.println(" - " + strs.poll() + " #" + strs.size());
System.out.println(" - " + strs.poll() + " #" + strs.size());
System.out.println(" - " + strs.poll() + " #" + strs.size());

}
}

불러오는 중...
취소
저장