Implementation of a Singularly LinkedList I'm new to C++ and trying to learn by implementing data structures in it.

Is the code below the most efficient way of implementing the data structure in C++? Does it conform to C++ standards, and how readable is it?

#include &lt;iostream&gt;

class Node
{
public:
    int data;
    Node *next;
    Node(int data)
    {
        this-&gt;data = data;
        this-&gt;next = nullptr;
    }
};

class LinkedList
{
public:
    Node *head;
    Node *tail;
    int length;
    LinkedList()
    {
        this-&gt;head = nullptr;
        this-&gt;tail = nullptr;
        this-&gt;length = 0;
    }

    void add(int data);
    void add(int data, int position);
    void delete_node(int position);
    int get_length();
    void print();
    int get_first();
};

void LinkedList::add(int data)
{
    Node *node = new Node(data);

    if (this-&gt;head == nullptr)
    {
        this-&gt;head = node;
    }
    else
    {
        this-&gt;tail-&gt;next = node;
    }
    this-&gt;tail = node;
    this-&gt;length = this-&gt;length + 1;
}

void LinkedList::add(int data, int position)
{
    Node *temp_head = this-&gt;head;
    Node *node = new Node(data);
    int i = 0;
    while (i &lt; this-&gt;length)
    {
        if (i == position - 1)
        {
            node-&gt;next = this-&gt;head-&gt;next;
            this-&gt;head-&gt;next = node;
        }
        this-&gt;head = this-&gt;head-&gt;next;
        i++;
    }
    this-&gt;head = temp_head;
    this-&gt;length = this-&gt;length + 1;
}

void LinkedList::print()
{
    Node *temp_head = this-&gt;head;
    while (this-&gt;head != nullptr)
    {
        std::cout &lt;&lt; this-&gt;head-&gt;data &lt;&lt; '\n';
        this-&gt;head = this-&gt;head-&gt;next;
    }
    this-&gt;head = temp_head;
}

int LinkedList::get_length()
{
    return this-&gt;length;
}

int LinkedList::get_first()
{
    return this-&gt;head-&gt;data;
}

int main()
{
    LinkedList *llist = new LinkedList();
    llist-&gt;add(0);
    llist-&gt;add(1);
    llist-&gt;add(3);
    llist-&gt;add(4);
    llist-&gt;add(2, 2);
    llist-&gt;print();
    std::cout &lt;&lt; "Length: " &lt;&lt; llist-&gt;get_length() &lt;&lt; '\n';
    std::cout &lt;&lt; "First Element : " &lt;&lt; llist-&gt;get_first() &lt;&lt; '\n';
}
C++ is not Java. You may safely get rid of all this-&gt;.
The client doesn't need to know about Node. Make it an inner class of the LinkedList.
The ~LinkedList() destructor is missing. You should also consider (or prohibit) the copy constructor, operator=, and move constructor.
add(int data, int position) may silently leak memory. If the position is too large, the created node is not linked into the list, and is lost. Also, there is no way to prepend a node.
I don't like the temp_head approach. Better leave the head alone, and iterate using a cursor variable, e.g.:

void LinkedList::print() {
    Node * cursor = head;
    while (cursor) {
        std::cout &lt;&lt; cursor-&gt;data &lt;&lt; '\n';
        cursor = cursor-&gt;next;
    }
}


At least, there is no need to restore head.

Ditto for add.