Saturday, 17 January 2015

Week 2



Last semester I took CSC108 so this week has mainly been a review. Our main topic of discussion was stacks and introduction to programming (such as how to think like a programmer).

A stack is a common ADT (abstract data type). It is a data structure that contains multiple elements, otherwise known as a collection.

An ADT is defined by the operations that can be performed on it, which is called an interface. The interface for a stack consists of these operations:
__init__
Initialize a new empty stack.
push
Add a new item to the stack.
pop
Remove and return an item from the stack. The item that is returned is always the last one that was added.
is_empty
Check whether the stack is empty.
An implementation is a set of methods that satisfy the syntactic and semantic requirements of an interface.
Our first lab was also this week. The work in our lab focused on designing and implementing classes as well as applying the proper recipe for designing functions. Unfortunately markus wasn't working so my partner and I weren't able to submit our work. 

No comments:

Post a Comment