Monday, 24 March 2014

week of march 5, 2014 csc148h1 winter 2014

Topic: Linked Lists.
In this week, linked lists are introduced as a new ADT.
According to wikipedia:
a linked list is a data structure consisting of a group of nodes which together represent a sequence.
a linked list is created as a form of a class similar to other forms of Object Oriented Programming.
In the initializer, what is created is a variable, a variable with list as a beginning item and it has a reference to the next list, and that has a reference to the next list, and so on... The linked list shares a strong similarity with the already-learned queue ADT, in a sense that inserting values into the linked list is done in chronological order, one value after the other. The first noticeable distinction is that, while a queue will only remember the top most value in its chain, the linked list can be worked on in various ways: insert, delete, reverse order.
The structure of the linked list is also unique in a sense that each item is represented by a list. The following is the skeletal structure of a linked list: [list a] -> [list b] -> [list c]....
each item contains items, and has a reference to the next item.
Compared to other ADT's, the linked list shares the property of one item referencing to the next item like a tree, except there can only be one child, and it is also like a tuple, where it can only be operated one item at a time.

No comments:

Post a Comment