Friday, March 13, 2015

Entry 7: Recap of Week 8 - Linked Lists

This week's main feature focus is the LLNode class; it represents a Linked List, which is a list of nodes connected by one another. This is best visualized with a diagram and Monday's lecture demonstrated that:




The key elements of a Linked List are the front, back and size. The front refers to the first node of a linked list, while the back refers to the last node of a linked list. Size is simply the total number of nodes in a linked list. The process of forming a method involves the same process of an if-else statement. This student mentioned that formulating a method requires an initial base case, followed by recursion. During the Wednesday lecture, Professor Heap spoke about specific methods associated with linked lists; one of them was _contains_. This method simply checks whether a specific node exists in a linked list. This involves scanning through each node of the linked list. I understood this process and had no problems with the other methods, but recursion remains to be a challenge in some cases. Hopefully, more practice strengthens my ability to write recursive methods. 

No comments:

Post a Comment