The Fifth Post
This is my fifth post about CSC148 course at University of Toronto. It has been quite some time since the course started. I have already attended a lot of labs, written a term test and submitted an assignment.
This week i will talk about one of the important focuses of this course - Abstract Data Types.
An abstract data type is a mathematical model for a data type where the data types are defined by their behavior, specifically in terms of the possible values, possible operations on the data type and the behavior of these operations. The concept of abstract data types was first used in the development of CLU language.
For example integers are abstract data types defined as the integer values : 1, 2, 0, -1, -2 etc. And by the operations of addition, subtraction, multiplication, division and etc. These operations follow the mathematical rules.
Another example for abstract data type would be a stack. A stack stores items and is defined by three operations - pop : an operation to remove the top item, push : an operation to add a new item to the top of the stack and is_empty : an operation to check whether the stack is empty or not.
Abstract data types are often considered purely theoretical and are used to simplify abstract algorithms or classify data structures. However an abstract data type can be implemented by specific data types or data structures. Abstract data types are commonly implemented as modules. The abstract data types are an important part of various topics such as data abstraction, object oriented programming and etc.
No comments:
Post a Comment