public void AddElement(int input) { try { StackHelper.CheckIfInt(input); } catch (Exception e) { throw e; } stack.Add(input); }
public void RemoveElement(int elementPosition) { try { StackHelper.CheckIfInt(elementPosition); } catch (Exception e) { throw e; } stack.Remove(stack.ElementAt(elementPosition)); }
public int GetPrevious() { try { StackHelper.CheckIfInt(elementPosition); } catch (Exception e) { throw e; } return(stack.ElementAt(elementPosition - 1)); }