Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void dumpStack(listNode *top, int currentDigit, int currentTable) {
- while (isEmpty() == 0) {
- listNode *temp = pop();
- int digit = getDigit(temp, currentDigit);
- int hashIndex = digit;
- addTail(hashTable[currentTable][hashIndex], temp);
- cout << "Added " << temp->data << " to hashTable[" << currentTable << "][" << hashIndex << "]" << endl;
- cout << hashTable[currentTable][hashIndex]->head->next->data << endl;
- }
- cout << "DONE DUMPSTACK" << endl;
- printTable(hashTable[currentTable]);
- cout << hashTable[currentTable][9]->head->next->data << endl;
- }
- void printTable(linkedListQueue **ht) {
- for (int i = 0; i < 10; i++) {
- linkedListQueue *temp = ht[i];
- if (isEmpty(temp) == 0) {
- cout << "Table [" << currentTable << "][" << i << "]:";
- while (temp->head->next != nullptr) {
- cout << " " << temp->head->next->data;
- if (temp->head->next->next != nullptr)
- cout << ",";
- temp->head->next = temp->head->next->next;
- }
- cout << endl;
- }
- }
- }
Add Comment
Please, Sign In to add comment