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