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:
@@ -6,15 +6,15 @@ package stack.utility;
|
||||
* Date: 05/03/14
|
||||
* Time: 0.49
|
||||
*/
|
||||
public class SinglePointerNode<E> {
|
||||
public class Node<E> {
|
||||
|
||||
public SinglePointerNode (){
|
||||
public Node(){
|
||||
element = null;
|
||||
next = null;
|
||||
|
||||
}
|
||||
|
||||
public SinglePointerNode (E in_element, SinglePointerNode<E> in_next){
|
||||
public Node(E in_element, Node<E> in_next){
|
||||
element = in_element;
|
||||
next = in_next;
|
||||
}
|
||||
@@ -27,15 +27,15 @@ public class SinglePointerNode<E> {
|
||||
this.element = element;
|
||||
}
|
||||
|
||||
public SinglePointerNode<E> getNext() {
|
||||
public Node<E> getNext() {
|
||||
return next;
|
||||
}
|
||||
|
||||
public void setNext(SinglePointerNode<E> next) {
|
||||
public void setNext(Node<E> next) {
|
||||
this.next = next;
|
||||
}
|
||||
|
||||
private E element;
|
||||
private SinglePointerNode<E> next;
|
||||
private Node<E> next;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user