The first part is simply defining the type that will be the backbone of a linked list: A Node. Each Node object carries some payload (an int in this case), and a pointer to the next Node in the list. If that pointer is NULL, then it is the last Node in a list. The class has three constructors.

The second part creates two linked lists. The first one is 5 -> 3 -> x, the second is 12 -> x, where x indicates list end or the NULL pointer. These two lists are pointed to by q and r respectively.