반응형
pop push isempty top
-
자료구조: Linked List로 Stack 구현하기 (feat. c++)알고리즘/자료구조 2021. 4. 16. 00:33
Characteristic: - MyStack class is stack class made Linked List Operations: - push - pop - top - isEmpty #include #include using namespace std; template class MyStack { public: MyStack(); void push(StackeElementType item); StackeElementType pop(); StackeElementType top(); bool isEmpty(); private: struct Node; typedef Node* Link; struct Node { StackeElementType data; Link next; }; Link head; }; t..