Help with insert

I'm stuck on this homework problem where he asks
1: Write a C++ program that has functions insert to insert a node into a linked list, and delete to delete a node from a linked list. The nodes should contain some non-integer data as well as a pointer to the next node.


I have to start with an empty list, inserting data that he will give me and then display the list and deleting data he asks me specifically to delete and displaying the list.

How do I do this?
start with this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
template <typename T>
class LinkedList {

    struct Node {
        T data;
        Node *next;
    } root;

public:
    void insert(const T &data) {

    }

    void delete(const T &data) {
    
    }

    void display() const {
    
    }
};




Topic archived. No new replies allowed.