|
|
|
|||||||||||||||||||||||
Now we will see what kind of
operations a programmer performs with a list data structure. Following long
list of operations may help you understand the things in a comprehensive
manner.
createList()
is a function
which creates a new list. For example
to create an array, we use int x[6] or
int* y = new int[20]; we need similar functionality in lists too. The copy() function will create a copy of
a list. The function clear() will
remove all the elements from a list. We want to insert a new element in the
list, we also have to tell where to put it in the list. For this purpose insert(X, position) function is used.
Similarly the function remove(position)
will remove the element at position. To get an element from the list get(position) function is used which
will return the element at position. To replace an element in the list at
some position the function update(X,
position) is used. The function find(X)
will search X in the list. The
function length() tells us about
the number of elements in the list. |
|||||||||||||||||||||||||
|
BACK |
HOME |
NEXT |
||||||||||||||||||||||