removed duplciated data-structures

This commit is contained in:
Christian Bender
2018-07-25 16:37:10 +02:00
parent 89b94a8f52
commit c86ba856a8
52 changed files with 75 additions and 30618 deletions

View File

@@ -53,16 +53,18 @@ class Stack{
* @return value popped off the Stack
*/
public int pop(){
if(isEmpty()){ //Checks for an empty stack
System.out.println("The stack is already empty");
return -1;
if(!isEmpty()){ //Checks for an empty stack
return stackArray[top--];
}
if(top < maxSize/4){
resize(maxSize/2);
return pop();// don't forget pop after resizing
}
else{
System.out.println("The stack is already empty");
return -1;
}
return stackArray[top--];
}
/**