Welcome back everyone! Or should I say welcome back to myself considering I have been away from sometime. I apologize to those who were patiently anticipating another post of mine. The school semester seems to have this magical phenomenon that time suddenly moves twice -- NO FOUR TIMES AS FAST-- as it did in the begin of the semester. And with that being said I apologize for not attending to my audience!
I will discuss linked lists today. This is a common data structure that does use recursion. A linked list is made up of 'nodes'. Each 'node' contains a reference to the next node in the list; furthermore, it contains a unit of data called the 'cargo'. The reason why a linked list is considered recursive is because a linked list either contains an empty list, represented by NONE, or by yet again(COUGH COUGH RECURSION ALERT) a node that contains a cargo object and a reference to a linked list.
First we would need to create a node class that will have these two attributes (cargo, and next).
If we just made three nodes with three different cargos and kept next parameter NONE then we have a set of nodes that are not linked in any manner. To link one node to the next we have to specify that particular object instance's next parameter to refer to the next node we are wanting to refer.
I will leave it at this note, as it sets the stage for the recursion part of linked lists. I will review those parts later tonight. I promise this time hahaha :)
Stay lazy!