Wednesday, January 21, 2015

Abstract Data Types (1/21/15)

I'm still working on figuring ADTs out, but this is my research on them so far.

My definition: An abstract data type is a way of defining certain data structures that act the same, across multiple programming languages. Abstract data types have been evaluated on their completion time and efficiency, and are often looked at for their limitations and their operations that they may perform. They are independent of particular implementation. They are defined mathematically, rather than implemented by the programming language.

Some examples: 
-Stacks
-Queues
-Trees
-Sets
-Maps
-Priority Queues
-Lists

ADTs have set operations that can be done to them. An example of this would be the abstract Stack, in which the only methods that can be done to it would be push and pop, and that its constraint is that "the sequence of operations { push(S,x); V ← pop(S) } is equivalent to { V ← x };" (Wikipedia). It usually also includes the methods of create, empty(create()), and notemptypush(S,x). They mean that a new stack is different from all previously created stacks, a newly created stack is empty, and pushing an object to a stack makes it not empty.


1 comment:

  1. Excellent! This is why I always felt AP Computer Science AB deserved a math credit. Since the study of data structures and algorithms is a mathematical topic if ever there was one. When they dropped the AB exam and only offered the A exam, I did not think the math credit was warranted.

    ReplyDelete