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()
return true if the stack is full, otherwise return false
isFull()
return an element from the list at any given position
get()
insert an element at any position of the list
insert()
remove the first occurance of any element from a non-empty list
remove()
remove the element at a specified location from a non empty list
removeAt()
replace an element at any position by another element
replace()
insert an element at the end of the queue
enqueue()
remove and return the first element of the queue, if the queue is not empty
dequeue()