public void CreateFirstNode(object value)
 {
     top      = new stackNode(value);
     top.next = null;
     bottom   = top;
     length++;
 }
        public void Pop()
        {
            if (length == 0)
            {
                Console.WriteLine("no data in stack");
                return;
            }

            var popItem = top.value;

            top = top.next;
            length--;
        }
        public void Push(object value)
        {
            if (length == 0)
            {
                CreateFirstNode(value);
                return;
            }

            var newTop = new stackNode(value);

            newTop.next = top;
            top         = newTop;
            length++;
        }
 public StackUsingLinkedList()
 {
     top    = null;
     bottom = top;
     length = 0;
 }
 public stackNode(object _value)
 {
     value = _value;
     next  = null;
 }