 Hi guys, so today we're going to be taking a look at the node class. So what exactly is a node? A node is a recursive data structure, and we can explore what this means with the help of an example. So in this example, if we take a look at the node constructor, we'll see that each instance of node contains two instance variables. Data, which is of primitive data type int and next, which holds a reference to another instance of node. Now you might find it helpful to envision nodes like people. For example, take person A. Person A contains data about herself, and she also holds a reference to another instance of person, her mother. In turn, person A's mother holds a reference to her mother, and so on and so on, with each person holding another instance of class person that refers to their mother. So how do we create a node instance? Well, if we take a look down in the node client, you'll see we have node A equals new node 10 null. So what we've done here is we've created an instance of node with data equals 10, next equals null, and object A refers to this instance of node. Underneath we have node B equals new node 70A. So here, an instance of node is created with data equals 70, and next is a reference to a copy of A. In other words, next refers to the same node instance that A refers to. Now you can see I've added a bunch of breakpoints here, and what we're going to do is we're going to run the program through the debugger, so we can see step by step how each node is related to each other node. So let's go ahead and do that. All right, so starting off, we have node A. Node A has a unique ID of 19, and if we expand A, you'll see we have A.data equals 10, and A.next equals null. So moving on, we have node B with a unique ID of 23, B.data equals 70, and B.next refers to an instance of node with an ID of 19. Now we can see here that B.next and A have the same ID. And this shows that B.next and A refer to the same instance of node. So moving forward, we have C. C.data equals 20, C.next equals null. Node D, we have D.data equals 90, and D.next refers to a node with an ID of 26. So once again, we can see that D.next and C refer to the same instance of node. And we can see this because they have the same ID. So moving forward, we have node E. E.data equals 30, E.next refers to a node with an ID of 29, which is the same ID as node D. So once again, node D and E.next refer to the same instance of node. Now if we move forward once more, we pass over the code C.next equals B. So what this does is it sets C.next to refer to node B. And we can see that this is indeed a code because C.next has an ID of 23, which is the same ID as node B. Now if we just step through, we can take a look at these print statements to get a better look at what's going on. So A holds a value of 10, A.data equals 10. So A holds a value of 10. Moving forward, similarly B holds a value of 70, C holds a value of 20, D holds a value of 90, and E holds a value of 30. Now we have node after B that is A holds a value of 10. So the node after B is B.next. B.next is A and A holds a value of 10. Moving on, node after C that is B holds a value of 70. So the node after C is C.next. C.next refers to B, B has a value of 70. The node after D which is C holds a value of 20. Once again, D.next refers to node with a value of 26. C also has an ID of 26 and C.data equals 20. Nerd after E that is D holds a value of 90. E.next equals D and D has a value of 90. All right, and then last one, the nerd after the nerd after E, which is C, holds a value of 20. So if we look here, E.next refers to D. D.next refers to C and C has a value of 20. So you can see what we've done here is we've created effectively a chain of nodes where E.next refers to D, D.next refers to C, C.next refers to B and B.next refers to A and A.next is null. So A does not refer to another node. So that was just a short presentation on the node class. So I hope you found this helpful and thank you for watching.