Esempio n. 1
0
 public IImmutableStack<T> Pop()
 {
     var newList = new LinkedList<T>(_list);
     newList.RemoveLast();
     return new Stack<T>(newList);
 }
Esempio n. 2
0
 public IImmutableStack<T> Push(T value)
 {
     var newList = new LinkedList<T>(_list) {value};
     return new Stack<T>(newList);
 }
Esempio n. 3
0
 private Stack(LinkedList<T> list)
 {
     _list = list;
 }