CSCA48H3 Lecture Notes - Lecture 1: Init

126 views2 pages
1 Mar 2016
School
Course

Document Summary

Exceptions: class emptyqueueerror(exception): pass def dequeue(self: "queue") -> object: if self. isempty(): raise emptyqueueerror. An abstract data type specifies a set of operations (or methods) and the semantics of the operations, but it does not specify the implementation of the operations. It simplifies the task of specifying an algorithm if you can denote the operations you need without having to think at the same time about how the operations are performed. Since there are usually many ways to implement an adt, it might be useful to write an algorithm that can be used with any of the possible implementation. Well-known adts, such as the stack adt are often implemented in standard libraries so they can be written once and used by many programmers. The operations on adts provide a common high level language for specifying and talking about algorithms. An adt is defined by the operations that can be performed on it, which is called an interface.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers