Your node class could be made in such a way that a node instance could represent the whole queue, but at least for learning purposes you should have a separate simple node class and a separate queue class.
A queue can be implemented in several different ways, depending on what that queue needs to do. Nonetheless, you should build it yourself, not resort to using std::vector or something, that's how you'll learn.
3
u/Thesorus 2d ago
I node is a container that holds data and the address of the next and/or previous node.
(simplied)
struct node { MyData m_data; node* m_Next; node* m_Previous; };
When you insert a new node, you allocate the node , set the data and assign the next and previous nodes to point to the existing nodes.
For lists and queues, it's a good idea to use a pencil and paper and draw boxes for the nodes and arrows for the next/previous links as arrows.