Linked List Stack with class node for resolving tower of honai [closed]

  c++, linked-list, stack

I am working on a Towers of Hanoi project in c++. After using stack array, I need to use linkedlist stack. Can somebody guide me how to complete the .h of node and linkedlist stack? Here is what I wrote

#include "Stack.h"
#include "Node.h"
#include "NotImplementedException.h"
class LinkedListStack : public Stack
{
public:

    LinkedListStack();
    ~LinkedListStack();
    void push(int element) override;
    void pop() override;
    int top() const override;
    bool isEmpty() const override;
    int size() const override;

private:
    Node* firstNode = nullptr;
    int length;
    
    
};

Node class

class Node
{
public:
    Node();
    ~Node();
    Node* getNextElement();
    void setNextElement(Node* nextElement);
    int* getContent();
    void setContent(int& content);

private:
    Node* nextElement;
    int* content;

    //À vous de créer les attributs nécessaires
};```

Source: Windows Questions C++

LEAVE A COMMENT