package KataProgramming;

public class ResizingArrayStackOfString {

	String [] s;
	int N = 0;
	
	public ResizingArrayStackOfString() {
		s = new String[1];
	}
	
	public void push(String item){
		
		if(N == s.length) resize(2 * s.length);
		s[N++] = item;
	}

	private void resize(int i) {
		String[] copy = new String[i];
		
		for (int j = 0; j < N; j++) {
			copy[j] = s[j];
		}
		
		s = copy;
		
	}
}

@@ -390,15 +390,208 @@
  copy;%0A%09
-%09
+%7D%0A%09%0A%09public String pop()%0A%09%7B%0A%09%09String item = s%5B--N%5D;%0A%09%09s%5BN%5D = null;%0A%09%09if(N %3E 0 && N == s.length / 4) resize(s.length/2); // diviser le tableau a 1/2 une fois il est rempli a 1/4%0A%09%09%0A%09%09return item;
 %0A%09%7D%0A%7D%0A

add pop method in ResizingArrayStackOfString