Fixato un bug nella SinglePointerStack e aggiunto due programmi. StackCheckParenthesis che verifica la correttezza delle parentesi tonde e graffe in una stringa utilizzando lo stack. StackInverString che inverte una stringa usando lo stack
This commit is contained in:
@@ -37,6 +37,7 @@ public class SinglePointerStack<E> extends StackRules<E> {
|
||||
}else{
|
||||
to_return = stack;
|
||||
stack = stack.getNext();
|
||||
--number_of_elements;
|
||||
return to_return.getElement();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user