Monday, March 24, 2014

March.01.2013

On the week of March.01.2013 we learnt about linked lists.  Luckily for me I had learned it previously in my high school, the difference was the use of variable names.  The next node would be initialized in the previous node stored in a variable called next, and this was all written under java.  So basically a linked lists is an object that consists of two variables, the current item value, and another variable, such as next, to point to the next list.  For example the linked list consisting of:

12 -> 14 -> 15 -> 17 -> None

Means that 12 is pointing to 14, which is pointing to 15 etc...  If I wanted to get to the node that consists of the item 15, I would refer to the head of the list, such that node with 15 is head.next.next.

No comments:

Post a Comment