Week 8 – Linked Structures
This
week in class we continued our discussion about linked structures. Especially
linked lists and how they can be represented using the tree class. Linked
structures are more efficient than regular python lists. If you have a data
structure of millions of items, a linked structure is your best bet for
efficiency and speed. If you were to remove the first item from a list of
millions of elements, it would take very long for the process to complete.
Whereas with a linked list, you just change the head and tail of the element
you are wanting to remove. We were taught two different concepts in linked
lists this week. They are both useful but different. The first method is as a
list made up of an item (value) and the remaining list (rest). The second
method was to represent it as objects (nodes) with a value and a reference to
other similar objects. This week we used the second method. We learned about a
wrapper class for linked list, insertion into the list, deletion, reversing and
string representation. We almost created a binary search tree that represents
data as a tree. You can search the tree very efficiently for an element.
In
class I enjoyed the binary search tree the most. Learning about new data
structures always sparks an interest in me. The most challenging and
frustrating part was in tutorials when we had to use a recursive algorithm to
create the functions of the class. It took us a long time to figure out we had
to use recursion. I feel confident with the lecture material but not the lab
material. We got our test marks back. I was satisfied with mine even after a
huge mistake on the final question.
No comments:
Post a Comment