Algorithm For Stack Using Array In Java