Saturday, February 6, 2016

Week 4 Stack, Queue, and Liked List

In CSC108, we had learned many basic Abstract Data Types, such as list, dictionary, tuples and so on. This week, we learned some ADTs which act like list, but own unique properties.

Stack & Queue
Stack is a LIFO (last-in, first-out) list, which means it is hard to add or delete in the middle of the stack, but you have the access to the most recently added item.
stack
Queue, unlike stack, is a FIFO (first-in, first-out) list. You are able to add new items at the end of the queue, but can only remove the earliest item.



queue

Linked-List
Linked-list is the most complex list. It is actually a group of nodes.

No comments:

Post a Comment