The previous examples is just let us get used to link list, but in practice we don ' t just use link list to input and show The data, in other word there is functions we can implement to link list and make it more powerful.
Here's an ADT definiton to link list:
ADT Linklistdata instances ordered finite collections of zero or more elements Operations Initial (*l): Initialize to create a empty link list l IsEmpty (L): Return Whether the list is empty Clear (*l): Cle AR list L to make it empty Getelem (L, I, *e): Get The ith element in list L, return it to e Haselem (L, E):
return true if found E in list L, otherwise Return false insert (*l, I, E): insert element E in the position I Of list L Delete (*l, I, *e): Delete the ith element e, and return e Length (L); Return number of elements in list Lendadt
Singlylinklist 3--What is we going to do?