링크드리스트
-
자료구조: Chained Hash Table 구현하기 (feat. c++)알고리즘/자료구조 2021. 5. 31. 21:36
Characteristic: - MyTable class is a hash table class consisted of linked list Operations: - insert - lookup - deletKey - dump #include using namespace std; const int MAX_TABLE = 11; template class MyTable { public: MyTable(); void insert(const tableKeyType& key, const tableDataType& data); bool lookup(const tableKeyType & key, tableDataType& data); void deleteKey(const tableKeyType& key); void ..
-
자료구조: Linked List Queue 구현하기 (feat. c++)알고리즘/자료구조 2021. 5. 31. 19:35
Characteristic: - MyQueue class is a Queue class consisted of linked list Operations: - enqueue - dequeue - front - isEmpty #include #include using namespace std; template class MyQueue { public: MyQueue(); void enqueue(queueElementType elem); queueElementType dequeue(); queueElementType front(); bool isEmpty(); private: struct Node; typedef Node* nodePtr; struct Node { queueElementType elem; no..
-
자료구조: 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..
-
자료구조: 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..