Friday, March 13, 2015

Week 9: impression of week 8

last week we were introduced to the concept of linked lists. Linked lists are kind of similar to trees as they have a value while referencing another list. Trees hold a value and reference its "children" thus making these two things similar. Linked lists are important data structures that can be very important in many fields of computer science.

What we have explored in linked lists is the fact that each linked list holds a node called a cargo. This cargo is a value that is stored. The other part of the linked list is the reference to another linked list node. This other node will also hold a cargo as well as another reference until eventually the linked list references None which marks the end of the linked list. As one might predict, this type of referencing and cargo holding can be done recursively. Since the linked list can reference upon itself, recursion makes the traversal of this linked list very simple to do. Another thing to note about linked lists is that they cannot be indexed and must be iterated over in order to go through the list. This is another reason why recursion is such a good method to go about handling linked lists since recursion will iterate until you set a condition that the function must meet. Linked lists is thus interesting and very fun to learn about.

2 comments:

  1. Linked list really troubled me at first, but I guess practice is the best way to solve the problem.

    ReplyDelete
  2. Nice to see how you've kept writing your SLOG posts. Good job!

    ReplyDelete