Friday, February 27, 2015

Summary about Abstract Data Type

An abstract data type is a new type of data used to store some information and have some operations on that information by using object oriented programming techniques. It is like creating a new type of variable used to store information. List, dictionary, tuple, etc. are all abstract data type that Python has already created for us. What we learned in the class is how to create a new type of abstract data type and its operations.
First, we created an abstract data type called stack. The property of a stack is similar to a list. It can store several items. It has a operation of removing the top item of the stack. It also has a operation of pushing item to the top of the stack. It can also tell if the stack is empty. Since the property is pretty similar to list, we can use list to create this abstract data type. All we need to add is pushing the item to the top and checking if the stack is empty functions.
Second, we practiced another abstract data type that is similar to stack called queue during a week's lab. It is similar to stack, but the difference is that it pushes item to the bottom of the queue and remove item from the bottom.
Third, we learned about ADT called tree. It is a type of ADT that stores a series of data that have relationship with each other. It can have a lot of operations and most of its operations involve using recursion. That's what makes this type of abstract data hard. 
The picture is an visualized example of a tree data type. It looks like a tree grows some leaves.

Overall, programming world are full of abstract data type. A program is built by abstract data type. They are used to store information and provide operations for the program. The core of programming is the use of abstract data type and their interactions. So, creating a mature abstract data type is essential for the convenience of programming.

No comments:

Post a Comment