ADT
-
자료구조: 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..
-
자료구조: 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..