674 Design and Analysis of Algorithms
C.3.4 Operations on Linked Lists
We have seen two operations on linear linked lists, insertion in front of the fi rst element and deletion of a
specifi ed element. Other possible operations are: insert at the end of the list, delete from the front, delete from
the end, insert according to some data item order, fi nd the number of elements in a list, and so on. Some of
these are shown implemented in
slfuncs1.c.
Sometimes we want that the incoming element be inserted in an existing list in a position corresponding
to a particular order depending on the value of one of the data items. This way of insertion will automatically
keep the list arranged in a sorted order, which is very important from the view point ...