Пример #1
0
        /// <summary>
        /// 스택의 입력 함수
        /// </summary>
        /// <param name="Data"></param>
        public void PuSH(T Data)
        {
            JeongStackNode <T> TempNode = new JeongStackNode <T>();

            TempNode.Data = Data;

            TempNode.Next = JStack;
            JStack        = TempNode;
            count++;
        }
Пример #2
0
        public void StackView()
        {
            JeongStackNode <T> current = JStack;

            while (current != null)
            {
                var data = current.Data;
                Console.WriteLine(data + " ->");
                current = current.Next;
            }
        }
Пример #3
0
        public T PoP()
        {
            try
            {
                if (count == 0)
                {
                    return(default(T));
                }

                var ResultData = JStack.Data;
                count--;
                JStack = JStack.Next;
                return(ResultData);
            }
            catch (Exception ex)
            {
                Console.WriteLine("오류 발견 ");

                return(default(T));
            }
        }
Пример #4
0
 public JeongStackNode()
 {
     Data = default(T);
     Next = null;
 }