Пример #1
0
        //Adds a new node at the top of the stack
        public void addFirst(string newString)
        {
            StringNode newNode = new StringNode(newString);

            newNode.Next = head;
            head         = newNode;
        }
Пример #2
0
        public string deleteFirst()
        {
            string data = null;
            StringNode toDelete = new StringNode(data);

            toDelete = head;
            head = head.Next;
            return toDelete.Data;
        }
Пример #3
0
        public string deleteFirst()
        {
            string     data     = null;
            StringNode toDelete = new StringNode(data);

            toDelete = head;
            head     = head.Next;
            return(toDelete.Data);
        }
Пример #4
0
        public int Count()
        {
            int        count      = 0;
            StringNode nodeWalker = head;

            while (nodeWalker != null)
            {
                count++;
                nodeWalker = nodeWalker.Next;
            }
            return(count);
        }
Пример #5
0
 //Adds a new node at the top of the stack
 public void addFirst(string newString)
 {
     StringNode newNode = new StringNode(newString);
     newNode.Next = head;
     head = newNode;
 }
Пример #6
0
 public StringNodeList()
 {
     head = null;
 }
Пример #7
0
 public StringNode(string data)
 {
     Data = data;
     Next = null;
 }
Пример #8
0
 public StringNodeList()
 {
     head = null;
 }