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