ADT (Abstract Data Type)
ADT (Abstract Data Type)
An Abstract Data Type (ADT) consists of data type together with a set of operations, which define how the
type may be manipulated.
ADT exists conceptually and concentrate on the mathematical properties of the data type ignoring
implementation constraints and details.
Modularity
Precise specifications
Information hiding
Simplicity
Integrity
Implementation independence
Stack as ADT
Stack can be defined as ADT:
Queue as ADT
Queue can be defined as ADT:
Graph as an ADT
i) Finite sequence of elements
ii) Operations on the elements like:
Graph () creates a new, empty graph.
addVertex (vert) adds an instance of Vertex to the graph.
addEdge (fromVert, toVert) adds a new, directed edge to the graph that connects two vertices.
addEdge (fromVert, toVert, weight) adds a new, weighted, directed edge to the graph that
connects two vertices.
getVertex (vertKey) finds the vertex in the graph name vertKey.
getVertices () returns the list of all vertices in the graph.