public IEnumerable <Key> keys() // toate cheile din tabela { StackLL <Key> stack = new StackLL <Key>(); for (Node x = first; x != null; x = x.next) { stack.push(x.key); } return(stack); }
static void Main(string[] args) { StackLL <string> sll = new StackLL <string>(); string line = "to be or not to be"; string[] tokens = line.Split(' '); foreach (var item in tokens) { sll.push(item); } //while (!sll.isEmpty()) //{ // Console.WriteLine(sll.pop()); //} foreach (var item in sll) { Console.WriteLine(item); } }