자료구조
-
자료구조: Dummy Inorder Linked List 구현하기 (feat. c++)알고리즘/자료구조 2021. 4. 16. 17:29
Characteristic: - MyList class is a Inorder(ascending order) Linked List class with dummy head Operations: - insert - first - next - remove #include #include using namespace std; typedef char ListElementType; class MyList { public: MyList(); void insert(const ListElementType& elem); bool first(ListElementType& elem); bool next(ListElementType& elem); void remove(const ListElementType& target); p..
-
자료구조: Inorder Linked List 구현하기 (feat. c++)알고리즘/자료구조 2021. 4. 16. 16:39
Characteristic: - MyList class is Inorder Linked List class, which is when you insert value, it is sorted in asending order. Operations: - insert - first - next #include #include using namespace std; typedef char ListElementType; class MyList { public: MyList(); void insert(const ListElementType& elem); bool first(ListElementType& elem); bool next(ListElementType& elem); private: struct Node; ty..
-
자료구조: Linked List 구현하기 (feat. c++)알고리즘/자료구조 2021. 4. 16. 15:12
Characteristic: - MyList class is a Linked List class with insertion to head and insertion to tail Operations: - insert_to_head - insert_to_tail - first - next #include #include using namespace std; typedef char ListElementType; class MyList { public: MyList(); ~MyList(); void insert_to_head(const ListElementType& elem); void insert_to_tail(const ListElementType& elem); bool first(ListElementTyp..
-
자료구조: Dynamic Linear List 구현하기 (feat. c++)알고리즘/자료구조 2021. 4. 16. 13:43
Characteristic: - MyList class is a List array class which can size dynamically Operations: - insert - first - next - getSize #include #include using namespace std; typedef char ListElementType; class MyList { public: MyList(int lSize); void insert(const ListElementType& elem); bool first(ListElementType& elem); bool next(ListElementType& elem); int getSize(); private: int listSize; ListElementT..
-
자료구조: 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..