Class Notes (839,189)
Canada (511,223)
CSC148H1 (92)
Paul Gries (18)


2 Pages

Computer Science
Course Code
Paul Gries

This preview shows 80% of the first page. Sign up to view the full 2 pages of the document.
Abstract Data Types (ADTs) • Abstract – existing in thought or as an idea but not having a physical or concrete existence • Data - the quantities, characters, or symbols on which operations are performed by a computer • Type - a category of people or things having common characteristics • ADT – a description of data and the operations define on that data o Ex. list, abstract understanding, different syntax btwn languages Abstract Data Type: discussion • Abstract o The user doesn’t want to know how it works o The user wants to know how to work it o Ex. how are python lists implemented? In almost every situation does anyone care? • Data o What information to record? • Type o Encapsulates a concept that is common to an entire set of objects Synonyms of “encapsulate”:  encase, contain, envelop, enfold, sheathe, cocoon, surround • ADT: data + operations on that data o ex. Pixel (from the media)  Data: a dot with a location and an RGB colour  Operations: get_x(), get_y(), get_color(), set_color(c), etc. o Ex. Str (a built-in type)  Data: a sequence of characters  Operations: capitalize(), isdigit(), strip(), find(sub), etc. • ADTs in Python o Python: you can define a new type by writing a class  Sometimes using the built-in ones like str would be too inconvenient o Classes encapsulate data and provide methods to operate on that data  Someone wrote python classes for every type used in 108 and in 108 we never care how they did it: we just called metho
More Less
Unlock Document

Only 80% of the first page are available for preview. Some parts have been intentionally blurred.

Unlock Document
You're Reading a Preview

Unlock to view full version

Unlock Document

Log In


Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.