Abstract Data Type
Data Type
Comes with its value and its operation
Integers, Reals, and Booleans are data types
Operations : add, subtract, multiply, divide, and,
or, XOR
Abstract Data Type
Designate data structure that comes with operations
List, Stack, Queue
2
List ADT
We will deal with a general list of the form :
a1, a2, a3, . . . , an
We say that the size of this list is n.
We will call the special list of size 0 a null list
ai+1 follows (or succeeds) ai (i < n) and that ai-1
precedes ai (i > 1)
The first element of the list is a1, and the last
element is an.
The position of element ai in a list is i.
3
List ADT
A set of operations that we would like to perform on
the list ADT
print_list – show current value store in list
make_null – delete all value from list
Search or find - returns the position of the first occurrence
of a key
insert and delete - insert and delete some key from some
position in the list
find_kth - returns the element in some position (specified as
an argument).