Thursday, 4 February 2016

Second blog

This week I am very interested in LinkedList. It is said that they are efficient in memory allocation and every node contains a value and next item. The next item points to the next node and the value is stored inside this node. The node is connected to a chain of nodes in a very simple way and it is just like a list but save spaces for memory.

I lecture we learned that for a linked list, it can contain front, back and size. The front points to front of the node and back points to back.The variable size is used to keep track of size of the node. When adding nodes to the back first I need to set the next of the back to the item that we are adding and point back to the new item. It is very interesting.

No comments:

Post a Comment