JAVA Queue , Queue Demo
Reference:최종명 외 2인,프로그래머를 위한 JAVA2 4E,홍릉출판사
ElementNode.java
ElementNode.java
- import java.util.*;
- public class ElementNode<T extends Comparable>{
- public ElementNode<T> next,previous;
- private T value;
- public ElementNode(T v){
- value = v;
- }
- public ElementNode left(){
- return previous;
- }
- public void left(ElementNode<T> l){
- previous=l;
- }
- public ElementNode right(){
- return next;
- }
- public void right(ElementNode<T> r){
- next=r;
- }
- public T getValue(){
- return value;
- }
- public void setValue(T v){
- value=v;
- }
- }
Q.java
댓글
댓글 쓰기