알고리즘
-
자료구조: 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 ..
-
자료구조: Array Table 구현하기 (feat. c++)알고리즘/자료구조 2021. 5. 31. 20:07
Characteristic: - Table class is an array Table class Operations: - insert - lookup - deleteKey #include #include using namespace std; const int MAX_TABLE = 100; template class Table { public: Table(); bool lookup(tableKeyType lookupKey, tableElementType& data); void insert(tableKeyType insertKey, tableElementType insertData); void deleteKey(tableKeyType deleteKey); private: struct item { tableK..
-
자료구조: 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..
-
자료구조: Circular Queue 구현하기 (feat. c++)알고리즘/자료구조 2021. 5. 31. 18:57
Characteristic: - queue class is an array Circular Queue class Operations: - enqueue - dequeue - front - isEmpty #include #include using namespace std; const int maxQueue = 10; int nextPos(int p); template class queue { public: queue(); void enqueue(QueueElementType e); QueueElementType dequeue(); QueueElementType front(); bool isEmpty(); private: int f; int r; QueueElementType queueArray[maxQue..
-
자료구조: 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..