package com.algorithms.stack;

/**
 * Created by Sumit on 01-Jul-17.
 */
public class ResizingArrayStackOfStrings {
}

@@ -28,49 +28,8 @@
 k;%0A%0A
-/**%0A * Created by Sumit on 01-Jul-17.%0A */
 %0Apub
@@ -67,11 +67,715 @@
 trings %7B
+%0A%0A    private String%5B%5D stack;%0A    private int N = 0;%0A%0A    public ResizingArrayStackOfStrings() %7B%0A        stack = new String%5B1%5D;%0A    %7D%0A%0A    public boolean isEmpty() %7B%0A        return (N == 0);%0A    %7D%0A%0A    public void push(String item) %7B%0A        if (N == stack.length) resize(stack.length * 2);%0A        stack%5BN++%5D = item;%0A    %7D%0A%0A    public String pop() %7B%0A        String item = stack%5B--N%5D;%0A        stack%5BN%5D = null;%0A%0A        if (N %3E 0 && N == (stack.length / 4)) resize(stack.length / 2);%0A        return item;%0A    %7D%0A%0A    private void resize(int capacity) %7B%0A        String%5B%5D copy = new String%5Bcapacity%5D;%0A        for (int i = 0; i %3C N; i++) %7B%0A            copy%5Bi%5D = stack%5Bi%5D;%0A        %7D%0A        stack = copy;%0A    %7D
 %0A%7D%0A

Add resizing array implementation of stack of strings