Week 8:
This week, we continued our lectures on tree structures. In addition, we were introduced to how to design wrappers using helper functions. A wrapper
function is a function that calls for a helper function to perform certain
tasks required. With the help of a helper function, complexity of a function can be reduced in comparison to a function that does not use one. It is often possible that functions
that do not perform recursion to call a helper function to perform recursion.
From the lecture notes this week, wrapper functions are used for both linked
list and binary tree structures for demonstrations. For instance, a helper function that returns the reverse of a linked list can be used in a wrapper function to reverse the linked list want.
During this week’s lab, we continued working on Linked list
based on the questions from the previous week. Overall, my partner and I managed
to finish most of the questions with the use of recursion or loops structures.
The objective of this lab is to help the students have a better understanding of
the linked list tree structure, and how methods can be applied to the linked
list object to perform various tasks.
Since linked list can references to another linked list, it
is possible to create a linked list with infinite length by referencing to
itself. The references to the linked lists also makes the linked list objects easily altered when
adding or deleting linked list objects, or reordering the linked list objects. It is possible
we will be seeing questions involving tree structures like linked list in the next midterm and
the final exam. Looks like I will have to start catching up with the course
materials if I ever want to do well in the next midterm and the final exam.
No comments:
Post a Comment