ABSTRAC DATA TYPE Flashcards
is a type (or class) for objects whose behavior is defined by a
set of values and a set of operations.
ABSTRACT DATA TYPE (ADT)
Is a kind of data type whose behavior is defined with the help of some attributes and
some functions.
ABSTRACT DATA TYPE (ADT)
TYPES OF ADT
STACK ADT
LIST ADT
QUEUE ADT
implementation instead of data being stored in each node, the pointer to data is stored.
STACK ADT
STACK ADT FUNCTIONS
push()
pop()
peek()
size()
isEmpty()
isFull()
LIST ADT FUNCTIONS
get()
insert()
remove()
removeAt()
replace()
size()
isEmpty()
isFull()
QUEUE ADT FUNCTIONS
enqueue()
dequeue()
peek()
size()
isEmpty()
isFull()
The data us generally stored in key sequence in a list which has a head structure consisting of count, pointers and address of compare function needed to compare the data in the list.
LIST ADT
Follows the basic design of the stack abstract data type
QUEUE ADT
Each node contains a void pointer to the data and the link pointer to the next element in the queue. The programs responsibility is to allocate memory for storing the data.
QUEUE ADT
insert an element at one end of the stack called top
push()
remove and return an element at the top of the stack, if its not empty
pop()
return the element (at the top of the stack/of the queue) without removing it, if the stack is not empty
peek()
return the number of elements in the stack/list/queue
size()
return true if the stack is empty, otherwise return false
isEmpty()