C++ algorithm that rearranges linked list based on pivot I wrote a small algorithm in C++ that rearranges linked list based on pivot. But my concern is that code is ugly with all the pointers and -&gt;. I don't think that modern C++ is written like this.
How do I improve this code?

#include &lt;iostream&gt;
#include &lt;string&gt;

class Node {
public:
    int value;
    Node* next;
    Node(int n) {
        value = n;
        next = NULL;
    };

    Node* partition(int around, Node* node) {
        Node* head = node;
        Node* tail = node;
        Node* temp = node;

        while (temp != NULL) {
            Node *next = temp-&gt;next;
            if (temp-&gt;value &lt; around) {
                temp-&gt;next = head;
                head = temp;
            } else {
                tail-&gt;next = temp;
                tail = temp;
            }
            temp = next;
        }

        tail-&gt;next = NULL;
        return head;
    }

    void printList() {
        Node *node = this;
        std::cout &lt;&lt; "List: ";
        while (node) {
            std::cout &lt;&lt; node-&gt;value &lt;&lt; " ";
            node = node-&gt;next;
        }
        std::cout &lt;&lt; std::endl;
    }
};

int main() {

    Node n0 = Node(6);
    Node n1 = Node(5);
    Node n2 = Node(4);
    Node n3 = Node(3);
    Node n4 = Node(2);
    Node n5 = Node(1);

    n0.next = &amp;n1;
    n1.next = &amp;n2;
    n2.next = &amp;n3;
    n3.next = &amp;n4;
    n4.next = &amp;n5;

    n0.printList();
    Node *result = n0.partition(3, &amp;n0);
    result-&gt;printList();

    return 0;
}
Those -&gt; are really a standard.

You could change them to the * dereference operator but the parenthesis apocalypse it requires to make it works in larger expressions will bother you more than everything.
In a small implementation like this one it's do-able though. 

Or, you may want to write your stuff in an immutable fashion. Meaning you don't use pointers and just use return values and arguments to functions to pass values.
Without modifying them (as variables) so you never have to use pointers.