adt

Abstract Data Types

Variable
name ; =5 set of values that it may assume ta . in eg value

Data type
set of values that a variable may assume set of operations

Abstract Data Type
mathematical set of values (model of data) set of operations

ADT: List
Definition:
sequence of zero or more elements of a given type

Operations
insert first, next, previous null find retrieve delete

Recursive definition:
a null or a pair of an element and a list

Subtypes:
single-linked list doubly-linked list

Implementation:
arrays records linked with pointers cursors

ADT: Stack
Definition:
A kind of list in which all insertions and deletions occur at one end (the top) a LIFO queue Last In First Out

Operations
push pop null

Implementation
array records linked with pointers

1

in which each element is given by an integer index A function from a continuous subset of integer type to the range type Operations: Assign (Set) Get Implementation: Array Growable Array (Reallocable Array) List ADT: Map or Associative Store Definition: A function from an element of a domain type to the range type An array in which indexes may be of any type (domain type) Operations: Assign (Set) Get Implementation: List of Pairs Vector of Pairs a hardware solution: Associative Memory 2 .ADT: Queue Definition: A kind of list in which elements are inserted at one and (the rear) and deleted at the other (the front) a FIFO queue First In First Out Operations: enqueue dequeue Implementation: records linked with pointers circular array ADT: Vector or Array Definition: A sequence of elements of a given type.

Sign up to vote on this title
UsefulNot useful