Linked List
-
자료구조: 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..
-
자료구조: Array로 Stack 구현하기 (feat. c++)알고리즘/자료구조 2021. 4. 15. 17:25
Characteristic: - MyStack class is stack class made by array operations: - push - pop - top - isEmpty - isFull #include #include using namespace std; const int maxStackSize = 1000; template class MyStack { public: MyStack(); void push(StackElementType item); StackElementType pop(); StackElementType top(); bool isEmpty(); bool isFull(); private: StackElementType stackArray[maxStackSize]; int topI..