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:
2014-03-17 12:11:39 +01:00
parent d60e74a09c
commit 08069c6b46
17 changed files with 318 additions and 95 deletions

View File

@@ -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;
}