Refactor di tutto lo stack. Manca l'esercizio sulle operazioni matematiche via stack. Sulla coda bisogna implementare da zero FixedArrayQueue e poi la relativa versione senza fullexception in ArrayQueue. Esercizi!
This commit is contained in:
41
stack/utility/Node.java
Normal file
41
stack/utility/Node.java
Normal file
@@ -0,0 +1,41 @@
|
||||
package stack.utility;
|
||||
|
||||
/**
|
||||
* Created with MONSTER.
|
||||
* User: xgiovio
|
||||
* Date: 05/03/14
|
||||
* Time: 0.49
|
||||
*/
|
||||
public class Node<E> {
|
||||
|
||||
public Node(){
|
||||
element = null;
|
||||
next = null;
|
||||
|
||||
}
|
||||
|
||||
public Node(E in_element, Node<E> in_next){
|
||||
element = in_element;
|
||||
next = in_next;
|
||||
}
|
||||
|
||||
public E getElement() {
|
||||
return element;
|
||||
}
|
||||
|
||||
public void setElement(E element) {
|
||||
this.element = element;
|
||||
}
|
||||
|
||||
public Node<E> getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
public void setNext(Node<E> next) {
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
private E element;
|
||||
private Node<E> next;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user