public void Push(Object value) { if(!_values.ContainsKey(value)) { _values.Add(value, value); Node temp = new Node(value); temp.next = _head; _head = temp; } }
public Object Pop() { if (_head != null) { Node temp = _head; _head = _head.next; temp.next = null; _values.Remove(temp.data); return temp.data; } else { return null; } }
public Problem2() { _head = null; _values = new Hashtable(); }
public Node(Object value) { next = null; data = value; }