abstract data types adts n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Abstract Data Types (ADTs) PowerPoint Presentation
Download Presentation
Abstract Data Types (ADTs)

Loading in 2 Seconds...

play fullscreen
1 / 4

Abstract Data Types (ADTs) - PowerPoint PPT Presentation


  • 84 Views
  • Uploaded on

An abstract data type (ADT) is a contract between the user of a data structure and its implementor. An ADT specifies: type of data stored (e.g. any objects, or only ints) available methods, with parameter and return types error conditions associated with methods

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Abstract Data Types (ADTs)' - mahina


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
abstract data types adts
An abstract data type (ADT) is a contract between the user of a data structure and its implementor.

An ADT specifies:

type of data stored (e.g. any objects, or only ints)

available methods, with parameter and return types

error conditions associated with methods

(optionally) performance guarantees, in terms of space and/or time

Can be very simple (list) or very complex (stock exchange).

Abstract Data Types (ADTs)

Stacks

benefits of adts
Benefits of ADTs
  • encapsulation: less to worry about
  • division of labor
  • promotes code sharing
  • cheaper sub-contracts
  • facilitates unit-testing

Stacks

list abstract data type adt
The List ADT models a sequence of positions storing arbitrary objects

It establishes a before/after relation between positions

Can be implemented in various ways:

array

singly-linked

doubly-linked

Accessor methods:

first(), last()

prev(p), next(p)

Update methods:

replace(p, e)

insertBefore(p, e), insertAfter(p, e),

insertFirst(e), insertLast(e)

remove(p)

convenience methods:

isEmpty()

List Abstract Data Type (ADT)

Stacks

position adt
The Position ADT models the notion of place within a data structure where a single object is stored

It gives a unified view of diverse ways of storing data, such as

a cell of an array

a node of a linked list

Just one method:

object element(p): returns the element stored at position p

Position ADT

Stacks