During the lecture from last week, prof introduced new term to us ---'Linked List'. It was an useful function for us to use during programming. The most advantage of linked list is that we can use it to insert any value to anywhere in the stacks without changing order of the whole stacks information.
As the picture shows above. We can generally divide linked node by three types: start node, intermediate nodes and end node. Start node refers to 'head' in the picture. For this node, it only connect with other behind it but front it. Intermediate nodes connect to previous node and next node. There exists space for memorizing the address of next node. The 'tail' refers to the end node which only connect to previous node. Because there is 'room' for node to store address of connecting node, we can easily manipulate its address to change its order or modify them. One thing we should keep in mind while using linked list is that linked list cannot be indexed but iterate over and go through the list.

No comments:
Post a Comment