The trailing arguments in the argument list of an operation may be optional. If these trailing arguments are missing in a call of an operation the default argument values given in the specification are used. For example, if the relative position argument in the list insert operation is missing it is assumed to have the value LEDA::after, i.e., L.insert(it, y) will insert the item <y> after item it into L.
There are two kinds of argument passing in C++, by value and by reference. An argument x of type type specified by `` type x'' in the argument list of an operation or user defined function will be passed by value, i.e., the operation or function is provided with a copy of x. The syntax for specifying an argument passed by reference is `` type& x''. In this case the operation or function works directly on x ( the variable x is passed not its value).
Passing by reference must always be used if the operation is to change the value of the argument. It should always be used for passing large objects such as lists, arrays, graphs and other LEDA data types to functions. Otherwise a complete copy of the actual argument is made, which takes time proportional to its size, whereas passing by reference always takes constant time.
Some operations take functions as arguments. For instance the bucket sort operation on lists requires a function which maps the elements of the list into an interval of integers. We use the C++ syntax to define the type of a function argument f:
T (*f)(T1, T2, ..., Tk)
declares f to be a function taking k arguments of the data types T1, ..., Tk, respectively, and returning a result of type T, i.e,