It is easier to understand linked list concept by picture:
In the picture above, node with value 2 is called the head because this node is the first node in the list and no other nodes are pointing to this node. Node with cargo 2 is pointing to node with cargo 6, which is called the tail (to be more precise, node 6, 4, and 7 are all called the tail of node with cargo 2). Let's take a look at the head (node cargo 2). There are two boxes: 1) the left box with value of 2, and 2) the right box with number 2184. The left box is the cargo of the node, while the right box is the memory address of the value of the next node (the node that node with cargo 2 is pointing to). The node with cargo 7 is pointing to Null, which means that node cargo 7 is the last node of this linked list.
I didn't find any difficulties to understand the concept of linked list. What I am struggling is when I am asked to write the class LinkedList and write some methods for class LinkedList, such as the method __setitem__, __delitem__, __insert__, and __len__. I am not certain why I am finding it difficult. Maybe it is because I am not yet good at writing code. I guess I only way to improve my programming language skill is to write codes more and seek help from instructors and TAs.
Even though I find some difficulties, I still find this topic to be very interesting. Furthermore, I find the materials in CSC148H1 more interesting than CSC108H1 because CSC148H1 focuses more in the concepts of different kind of data structures, whereas CSC108H1 only focuses on the Python languages.

No comments:
Post a Comment