Professional Documents
Culture Documents
List Adt
List Adt
List Adt
Definition
● In computer science, an abstract data type
(ADT) is a mathematical model for data types,
where a data type is defined by its behavior
(semantics) from the point of view of a user of
the data, specifically in terms of possible values,
possible operations on data of this type, and the
behavior of these operations.
● This contrasts with data structures, which are
concrete representations of data, and are the
point of view of an implementer, not a user.
Definition
● A data structure is a collection of data
values, the relationships among them, and
the functions or operations that can be
applied to the data
● Data structures can implement one or
more particular abstract data types (ADT),
which specify the operations that can be
performed on a data structure and the
computational complexity of those
operations.
● Formally, an ADT may be defined as a "class of
objects whose logical behavior is defined by a
set of values and a set of operations";
●
● Data Structure: They are used to store
data in organised form in computer.
●
public interface List<E> extends Collection<E> {
// Positional Access
E get(int index);
E set(int index, E element); // Optional
boolean add(E element); // Optional
void add(int index, E element); // Optional
E remove(int index); // Optional
// Search
int indexOf(Object o);
// Iteration
ListIterator<E> listIterator();
// Rangeview
List<E> subList(int from, int to);
int size();
}
● MyList.get(2)