'C++ Multi Level Linked List Add
Hello everyone I'm trying to implement constructer and sorted add method for this this structure but I can not get the idea of the Multi&doubly linked list. Any idea or help? (You can help me with class system or struct system doesn't matter.)
class MultiLLNode {
public:
MultiLLNode() {
next_name = nullptr;
prev_name = nullptr;
next_ext = nullptr;
prev_ext = nullptr;
next_size = nullptr;
prev_size = nullptr;
}
string infos[3]; // infos[0] = name, infos[1] = extension, infos[2] = size
MultiLLNode *next_name, *prev_name, *next_ext, *prev_ext, *next_size, *prev_size;
};
///////////////////////////////////////////////////////////////////////////
struct Node
{
struct Node *prev_n;
string name;
struct Node *next_n;
struct Node *prev_e;
string extension;
struct Node *next_e;
struct Node *prev_s;
string size;
struct Node *next_s;
}*first=nullptr;
void create(const vector<vector<string>>& A, int n)
{
struct Node *t, *last;
int i;
first = (struct Node *)malloc(sizeof(struct Node));
first->name = A[0][0];
first->prev_n = first->next_n = nullptr;
last = first;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
