// create struct Node with 2 fields: Int 'data' and pointer to Node "next"
struct Node{
int data;
Node *next;
};
Node *n1, *n2; // declare two pointers to Node, 'n1' and 'n2'
n1 = new Node; // make new Node and have n1 point to it
n2 = new Node; // make new Node and have n2 point to it
n1->data = 1; // data field of Node that n1 is pointing to = 1
n2->data = 2;// data field of Node that n2 is pointing to = 2
n1->next = n2; // n1's next pointer points to n2
n2->next = n1; // n2's next pointer points to n1
// at this point we have two nodes, and each one's next pointer point to the other
// you can picture it as a circle. n1 to n2, to n1, to n2 ....
//Two next pointers used, meaning we have to start at node n2,
// then move up two nodes, then set that nodes data field to 7.
//n2->next (that brings you to n1) ->next (brings you to n2)
// -> data = 7 (n2's data field is now 7)
n2->next->next->data = 7;